views:

78

answers:

2

I'd like to start multiple HTTP requests rapidly after each other, without having to wait on the previous response to arrive. I've tried this using WebClient.UploadStringAsync, but this doesn't work. I'd like to efficiently implement the following scenario:

  • Send request 1
  • Send request 2
  • Send request 3

And in another thread:

  • Receive response 1
  • Receive response 2
  • Receive response 3

Can this be done in Silverlight?

+1  A: 

Yes it can be done. What leads you to believe that UploadStringAsync isn't working?

Here is my guess you are posting to ASP.NET with Sessions turned on (the default) right?

The requests will be queued at the server end because ASP.NET will only process one request for a specific Session at a time.

AnthonyWJones
Thanks for the response, but we aren't using ASP. Instead, I am working on a prototype for doing IPC over HTTP between our Silverlight client and C++ server application.
Dimitri C.
@Dimitri: Do you need to be on port 80 and/or use the HTTP protocol? If not have you consider using sockets to get a much finer level of control?
AnthonyWJones
@Anthony: If it were for me, it wouldn't matter which port there is used. However, my colleagues of the support department tell me our customers always complain if their firewalls and/or proxy servers need to be reconfigured. In this context I also hear praising web applications, because they always use the same port, which is unrestricted. Therefore, I think it would be nice if our Silverlight application could communicate over the "well-known" HTTP port 80.
Dimitri C.
+3  A: 

I'd like to start multiple HTTP requests rapidly after each other, without having to wait on the previous response to arrive

That's called HTTP Pipelining (assuming you hope to use the same socket) and it's not supported by many proxies and gateway devices. I would be surprised if Silverlight tried to support it.

EricLaw -MSFT-