title: multiple clients - one server connection with sockets tcp/ip c# .net
body: <p>I need to develop a client server system where I can have multiple clients communicating with one server at the same time. I want to communicate xml serialized objects and also need to send and receive other commands to invoke methods. Now, I am just starting with socket programming in C# and .Net and found that the asynchronous I/O is the way to go so that the methods dont block the execution of code. Also there are many examples of how to </p>
  
  <p>make a simple client server system. So I have a basic understanding of how that works. </p>
  
  <p>Anyway, what still is not clear to me is how I can set up a server which can manage connections to multiple clients? 
  Can I just create a new socket per connection and then store those in some kind of list?
  Do I need some kind of multiplexing to achieve this? 
  Do I have to listen at multiple ports?
  What`s the best way here?</p>
  
  <p>And the other thing is if I need to develop my own protocol to differentiate between what I am actually sending over the network --> xml serialized object or a command which might be just a string encoded in ascII or something. Or would I develop my own protocol just to send these commands?</p>
  
  <p>Any kind of help is apreciated! If someone knows a good book which covers this sort of stuff, let me know. Cheers</p>
  
  <p>I forgot to mention that some of my clients which are supposed to communicate with my server will be pda and I therefore use the compact framework... So this might bring in some restrictions...</p>