Possible Duplicate:
multi client/server chat program in c#?
I've been trying for some time to build a simple client-server chat, and I keep finding that there are a number of different ways.
I was just curious as to what the most correct way would be.
The first involves creating a new socket, binding it to a specific port and any IP Address, then listening for new connections (and that's as far as the tutorial leads). The next involves using a TcpListener to listen on a specific port (though it issues a warning saying that its deprecated, and I must include an IP address), it then waits for a new TCP connection, then creates either a new hashtable or new list to store the TcpClient(s). And that's all server side. Client side its pretty much the same, always trying to connect to the server.
So, what's the best way to go about building one? Also, should I use StreamReader and StreamWriter (which some tuts use), or should I use NetworkStream, what should I use to transfer the messages?