Shark_M wrote:Than you for your reply,
What about the Windows Server 2003? Would it choke at 500 concurrent connection?
And, can you show me a small example (code) as to how to know if a remote client has disconnected or is idle?
I don't know about Windows Server, but in most scenarios you don't want 500 connections. Imagine how much memory you'd need to keep some of the state for each of the connections.
In most cases, what you'd do is have some number of connections active and keep the list of all possible clients you'd possibly want to connect to and then connect and disconnect as need arises.
You can trivially know if a client is idle by making sure that if some number of seconds passes without any activity, then that client is idle
To detect if a client has disconnected I'd need to know which model (synchronous or asynchronous) you are using. I will assume that it's the latter. In that case, it is enough to detect if Socket.EndSend returned 0 (zero) bytes. Also, clients can disconnect in many other scenarios and sometimes .NET will throw SocketException or ObjectDisposedException, so most if not all of your Socket calls need to be wrapped in try/catch blocks.
Again, I recommend you start with something simple and move on to more complex stuff gradually. You won't be able to write a robust network applications by asking questions on forums like this one. You need to get a book on network programming and check out some .NET code examples. The site I mentioned in a previous post is excellent resource.