System.Net.Sockets.TcpClient Class

Provides client connections for TCP network services.

See Also: TcpClient Members


public class TcpClient : IDisposable


The System.Net.Sockets.TcpClient class provides simple methods for connecting, sending, and receiving stream data over a network in synchronous blocking mode.

In order for System.Net.Sockets.TcpClient to connect and exchange data, a System.Net.Sockets.TcpListener or System.Net.Sockets.Socket created with the TCP System.Net.Sockets.ProtocolType must be listening for incoming connection requests. You can connect to this listener in one of the following two ways:


If you want to send connectionless datagrams in synchronous blocking mode, use the System.Net.Sockets.UdpClient class.


Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0,,