By Patrick Lam
This is the second version of my client/server program. The server and the client can be run on the same machine or on different machines. The following is the brief description of the server and the client programs specifically.
sampleTcpUdpServer2.cs: This program functions exactly the same as v1 posted earlier. The only difference is in the coding. It employs a more efficient coding way for the socket programming. It uses the TcpListener class provided by the .Net class library, instead of the traditional (bind/listen/accept) way employed in v1.
sampleTcpUdpClient2.cs: Similar to te changes made to the server program, this client program employs a more efficient way of socket programming provided by the .Net class library. It uses TcpClient and UdpClient classes instead of the traditional way employed in v1.
There is lots of documentation located in the .cs files.
Download sampleTcpUdpClient2.cs
Download sampleTcpUdpServer2.cs