System.Net.Sockets.TcpClient Class

Provides client connections for TCP network services.

See Also: TcpClient Members

Syntax

public class TcpClient : IDisposable

Remarks

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:

Note:

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

Requirements

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