System.Net.Sockets.TcpClient Members

The members of System.Net.Sockets.TcpClient are listed below.

See Also: Inherited members from System.Object

Public Constructors

Initializes a new instance of the System.Net.Sockets.TcpClient class.

Initializes a new instance of the System.Net.Sockets.TcpClient class and binds it to the specified local endpoint.

Initializes a new instance of the System.Net.Sockets.TcpClient class with the specified family.

Initializes a new instance of the System.Net.Sockets.TcpClient class and connects to the specified port on the specified host.

Public Properties

[read-only]
Availableint.

Gets the amount of data that has been received from the network and is available to be read.

ClientSocket.

Gets or sets the underlying System.Net.Sockets.Socket.

[read-only]
Connectedbool.

Gets a value indicating whether the underlying System.Net.Sockets.Socket for a System.Net.Sockets.TcpClient is connected to a remote host.

ExclusiveAddressUsebool.

Gets or sets a bool value that specifies whether the System.Net.Sockets.TcpClient allows only one client to use a port.

LingerStateLingerOption.

Gets or sets information about the linger state of the associated socket.

NoDelaybool.

Gets or sets a value that disables a delay when send or receive buffers are not full.

ReceiveBufferSizeint.

Gets or sets the size of the receive buffer.

ReceiveTimeoutint.

Gets or sets the amount of time a System.Net.Sockets.TcpClient will wait to receive data once a read operation is initiated.

SendBufferSizeint.

Gets or sets the size of the send buffer.

SendTimeoutint.

Gets or sets the amount of time a System.Net.Sockets.TcpClient will wait for a send operation to complete successfully.

Protected Properties

Activebool.

Gets or set a value that indicates whether a connection has been made.

Public Methods

BeginConnect(System.Net.IPAddress, int, AsyncCallback, object) : IAsyncResult

Begins an asynchronous request for a remote host connection. The remote host is specified by an System.Net.IPAddress and a port number (int).

BeginConnect(System.Net.IPAddress[], int, AsyncCallback, object) : IAsyncResult

Begins an asynchronous request for a remote host connection. The remote host is specified by an System.Net.IPAddress array and a port number (int).

BeginConnect(string, int, AsyncCallback, object) : IAsyncResult

Begins an asynchronous request for a remote host connection. The remote host is specified by a host name (string) and a port number (int).

Close()

Disposes this System.Net.Sockets.TcpClient instance and requests that the underlying TCP connection be closed.

Connect(System.Net.IPEndPoint)

Connects the client to a remote TCP host using the specified remote network endpoint.

Connect(System.Net.IPAddress, int)

Connects the client to a remote TCP host using the specified IP address and port number.

Connect(System.Net.IPAddress[], int)

Connects the client to a remote TCP host using the specified IP addresses and port number.

Connect(string, int)

Connects the client to the specified port on the specified host.

ConnectAsync(System.Net.IPAddress, int) : System.Threading.Tasks.Task

Connects the client to a remote TCP host using the specified IP address and port number as an asynchronous operation.

ConnectAsync(System.Net.IPAddress[], int) : System.Threading.Tasks.Task

Connects the client to a remote TCP host using the specified IP addresses and port number as an asynchronous operation.

ConnectAsync(string, int) : System.Threading.Tasks.Task

Connects the client to the specified TCP port on the specified host as an asynchronous operation.

EndConnect(IAsyncResult)

Ends a pending asynchronous connection attempt.

Finalize()

Frees resources used by the System.Net.Sockets.TcpClient class.

GetStream() : NetworkStream

Returns the System.Net.Sockets.NetworkStream used to send and receive data.

Protected Methods

Dispose(bool)

Releases the unmanaged resources used by the System.Net.Sockets.TcpClient and optionally releases the managed resources.

Explicitly Implemented Interface Members

IDisposable.Dispose

Releases all resources used by the System.Net.Sockets.TcpClient.