from Hacker News

Ask HN: Speed up HTTP Post, desktop app

by atiw on 3/24/10, 5:28 AM with 2 comments

I want to speed this up. I was playing around doing HTTP post, using normal desktop app, in C#. All I am trying to do is send a few lines of code (200-500 LOC) using HTTP post, to my server, where I have a server side PHP code, that uses this code, generates some result and sends it back.

The results again are just some <100 LOC.

Now, the time taken varies A LOT. It goes from anywhere between 2 seconds, to 30 seconds and sometimes the message is just simply LOST.

I know this because, I do have a timer that calculates the time taken as well.

Now, I think this should be pretty simple to solve, right? Except, I am finding it hard to find... And I am new to doing HTTP like this, outside a browser....

Now that raises questions, if the only reason this is happening is that I am using HTTP ffrom C# inside a desktop app, instead of a browser seems absurd to me, but I keep thinking along those lines...

Oh, FYI, this is pretty similar to what I am doing....

http://msdn.microsoft.com/en-us/library/debx8sh9.aspx

Check out the C# one.

Except, "postData" in my case is autogenerated by some other code, and is usually anywhere between 200-500 LOC approx. and the "response" is my results, which is some 100 KLOC.

This reminds me, how do I make the above link display as a link, when I submit questions, or respond to something in HN ??

I think the above link should be showing as a simple text....