views:

295

answers:

1

hello, i'm creating an Asynchronous socket programming in vb.net. i've utilised the code from Asynchronous client and server code frtom the following links:

http://msdn.microsoft.com/en-us/library/fx6588te.aspx for server program

The client program is present in the same link in /bew39x2a.aspx(sorry i'm a new user so could post only one link fully)

When I try to connect the for more than one client the second client always waits until the first client completes the call. i want the clients to accept calls at the same time... Does WCF help to make multiple clients to accept calls at the same time??? if so what is WCF and how will it help. Or is there any other concept which can help???

Any queries about the programs, please follow the above links. tell me the program for this. its very urgent for my project and i'm a novice in socket programming.

Thank you in advance

A: 

Yes, WCF can help you there. But it implements only well known protocols like SOAP, WS-*, JSON, and a few proprietary ones like binary TCP binding.

You'd only use async socket programming if you need

  • High scalability (more than 20 simultaneous clients)
  • A custom protocol

If you build on top of HTTP, I recommend the HttpListener class

If you need a custom protocol with a few clients, use synchronous socket programming with multiple threads.

If you still want to implement a server with async sockets, then you need a continuous loop that accepts connections (after EndAccept() immediately call BeginAccept() again) and then start the BeginReceive()

I can tell you from experience though that debugging such a server is not easy. It's quite hard to follow the chain of events even through a detailed log file. Good luck with that :)

chris166