Sending Data over UDP using UdpClient

Friday, July 4th, 2008

Few days ago I wrote a post how to send data over TCP. Today, I’d like to share a sample how to do it over UDP using UdpClient class. What we cannot do is to keep the state of our connection between sender and receiver. That is because the UDP protocol is stateless. The sender just sends a datagram [...]

Sending data over TCP using TcpClient and TcpListener

Tuesday, July 1st, 2008

Sometimes we need to send data via TCP. For this purpose .Net contains two classes - TcpClient and TcpListener.
Let’s assume that we need transfer a list of contacts from a server to client. [Update 07/04/2008: The Contact class is presented in the snippet below. Note that it is decorated with Serializable attribute. It is needed because [...]