

SampleTcpThread = new Thread( new ThreadStart(StartListen2)) Ĭonsole.WriteLine("Started SampleTcpUdpServer's TCP Listener Thread!\n") Ĭonsole.WriteLine("An TCP Exception has occurred!" + e.ToString()) Public Thread sampleTcpThread, sampleUdpThread When you compare the following code with v1, you will see the * instead of the traditional raw socket implementation (The UDP part is still * it intends to demonstrate is the amount of code you can save by using * Brief : The simple multi-threaded TCP/UDP Server v2 does the same thing as v1. * Project : Simple Multi-threaded TCP/UDP Server v2 how are you?"Īll the other information is provided at the beginning of each file. Usage : sampleTcpUdpClient2 "Any message."Įxample: sampleTcpUdpClient2 TCP your_hostname "hello. It uses TcpClient and UdpClient classes instead of the traditional 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, instead of the traditional (bind/listen/accept) way employed in v1.

It uses the TcpListener class provided by the. It employs a more efficient coding way for the socket programming. SampleTcpUdpServer2.cs: This program functions exactly the same as v1 posted earlier. The following is the brief description of the server and the client programs specifically. The server and the client can be run on the same machine or on different machines.

This is the second version of my client/server program.
