System.Net.Sockets.Socket: Method Members

The methods of System.Net.Sockets.Socket are listed below. For a list of all members, see the Socket Members list.

See Also: Inherited members from System.Object

Public Methods

Accept() : System.Net.Sockets.Socket

Creates a new System.Net.Sockets.Socket for a newly created connection.

AcceptAsync(System.Net.Sockets.SocketAsyncEventArgs) : bool

Begins an asynchronous operation to accept an incoming connection attempt.

BeginAccept(AsyncCallback, object) : IAsyncResult

Begins an asynchronous operation to accept an incoming connection attempt.

BeginAccept(int, AsyncCallback, object) : IAsyncResult

Begins an asynchronous operation to accept an incoming connection attempt and receives the first block of data sent by the client application.

BeginAccept(System.Net.Sockets.Socket, int, AsyncCallback, object) : IAsyncResult

Begins an asynchronous operation to accept an incoming connection attempt from a specified socket and receives the first block of data sent by the client application.

BeginConnect(EndPoint, AsyncCallback, object) : IAsyncResult

Begins an asynchronous request for a remote host connection.

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

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

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

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

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

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

BeginDisconnect(bool, AsyncCallback, object) : IAsyncResult

Begins an asynchronous request to disconnect from a remote endpoint.

BeginReceive(IList<ArraySegment<byte>>, System.Net.Sockets.SocketFlags, AsyncCallback, object) : IAsyncResult

Begins to asynchronously receive data from a connected System.Net.Sockets.Socket.

BeginReceive(IList<ArraySegment<byte>>, System.Net.Sockets.SocketFlags, out System.Net.Sockets.SocketError, AsyncCallback, object) : IAsyncResult
Documentation for this section has not yet been entered.
BeginReceive(byte[], int, int, System.Net.Sockets.SocketFlags, AsyncCallback, object) : IAsyncResult

Begins to asynchronously receive data from a connected System.Net.Sockets.Socket.

BeginReceive(byte[], int, int, System.Net.Sockets.SocketFlags, out System.Net.Sockets.SocketError, AsyncCallback, object) : IAsyncResult
Documentation for this section has not yet been entered.
BeginReceiveFrom(byte[], int, int, System.Net.Sockets.SocketFlags, ref EndPoint, AsyncCallback, object) : IAsyncResult
Begins an asynchronous operation to receive data from a socket and, for connectionless protocols, store the endpoint associated with the socket that sent the data.
BeginReceiveMessageFrom(byte[], int, int, System.Net.Sockets.SocketFlags, ref EndPoint, AsyncCallback, object) : IAsyncResult
Documentation for this section has not yet been entered.
BeginSend(IList<ArraySegment<byte>>, System.Net.Sockets.SocketFlags, AsyncCallback, object) : IAsyncResult

Sends data asynchronously to a connected System.Net.Sockets.Socket.

BeginSend(IList<ArraySegment<byte>>, System.Net.Sockets.SocketFlags, out System.Net.Sockets.SocketError, AsyncCallback, object) : IAsyncResult
Documentation for this section has not yet been entered.
BeginSend(byte[], int, int, System.Net.Sockets.SocketFlags, AsyncCallback, object) : IAsyncResult

Sends data asynchronously to a connected System.Net.Sockets.Socket.

BeginSend(byte[], int, int, System.Net.Sockets.SocketFlags, out System.Net.Sockets.SocketError, AsyncCallback, object) : IAsyncResult
Documentation for this section has not yet been entered.
BeginSendFile(string, AsyncCallback, object) : IAsyncResult

Sends the file fileName to a connected System.Net.Sockets.Socket object using the TransmitFileOptions.UseDefaultWorkerThread flag.

BeginSendFile(string, byte[], byte[], System.Net.Sockets.TransmitFileOptions, AsyncCallback, object) : IAsyncResult

Sends a file and buffers of data asynchronously to a connected System.Net.Sockets.Socket object.

BeginSendTo(byte[], int, int, System.Net.Sockets.SocketFlags, EndPoint, AsyncCallback, object) : IAsyncResult

Sends data asynchronously to a specific remote host.

Bind(EndPoint)

Associates a System.Net.Sockets.Socket with a local endpoint.

Close()

Closes the System.Net.Sockets.Socket connection and releases all associated resources.

Close(int)

Closes the System.Net.Sockets.Socket connection and releases all associated resources with a specified timeout to allow queued data to be sent.

Connect(EndPoint)

Establishes a connection to a remote host.

Connect(IPAddress, int)

Establishes a connection to a remote host. The host is specified by an IP address and a port number.

Connect(IPAddress[], int)

Establishes a connection to a remote host. The host is specified by an array of IP addresses and a port number.

Connect(string, int)

Establishes a connection to a remote host. The host is specified by a host name and a port number.

ConnectAsync(System.Net.Sockets.SocketAsyncEventArgs) : bool

Begins an asynchronous request for a connection to a remote host.

Disconnect(bool)

Closes the socket connection and allows reuse of the socket.

DisconnectAsync(System.Net.Sockets.SocketAsyncEventArgs) : bool

Begins an asynchronous request to disconnect from a remote endpoint.

Dispose()

Releases all resources used by the current instance of the System.Net.Sockets.Socket class.

DuplicateAndClose(int) : System.Net.Sockets.SocketInformation

Duplicates the socket reference for the target process, and closes the socket for this process.

EndAccept(IAsyncResult) : System.Net.Sockets.Socket

Asynchronously accepts an incoming connection attempt and creates a new System.Net.Sockets.Socket to handle remote host communication.

EndAccept(out byte[], IAsyncResult) : System.Net.Sockets.Socket
Documentation for this section has not yet been entered.
EndAccept(out byte[], out int, IAsyncResult) : System.Net.Sockets.Socket
Documentation for this section has not yet been entered.
EndConnect(IAsyncResult)

Ends a pending asynchronous connection request.

EndDisconnect(IAsyncResult)

Ends a pending asynchronous disconnect request.

EndReceive(IAsyncResult) : int

Ends a pending asynchronous read.

EndReceive(IAsyncResult, out System.Net.Sockets.SocketError) : int
Documentation for this section has not yet been entered.
EndReceiveFrom(IAsyncResult, ref EndPoint) : int
Ends an asynchronous call to receive data from a socket and store the endpoint associated with the socket that sent the data.
EndReceiveMessageFrom(IAsyncResult, ref System.Net.Sockets.SocketFlags, ref EndPoint, out System.Net.Sockets.IPPacketInformation) : int
Documentation for this section has not yet been entered.
EndSend(IAsyncResult) : int

Ends a pending asynchronous send.

EndSend(IAsyncResult, out System.Net.Sockets.SocketError) : int
Documentation for this section has not yet been entered.
EndSendFile(IAsyncResult)

Ends a pending asynchronous send of a file.

EndSendTo(IAsyncResult) : int

Ends a pending asynchronous send to a specific location.

Finalize()

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

override
GetHashCode() : int

Returns a hash value for a System.Net.Sockets.Socket instance.

GetSocketOption(System.Net.Sockets.SocketOptionLevel, System.Net.Sockets.SocketOptionName) : object

Returns the value of a specified System.Net.Sockets.Socket option, represented as an object.

GetSocketOption(System.Net.Sockets.SocketOptionLevel, System.Net.Sockets.SocketOptionName, byte[])

Returns the specified System.Net.Sockets.Socket option setting, represented as a byte array.

GetSocketOption(System.Net.Sockets.SocketOptionLevel, System.Net.Sockets.SocketOptionName, int) : byte[]

Returns the value of the specified System.Net.Sockets.Socket option in an array.

IOControl(int, byte[], byte[]) : int

Sets low-level operating modes for the System.Net.Sockets.Socket using numerical control codes.

IOControl(System.Net.Sockets.IOControlCode, byte[], byte[]) : int

Sets low-level operating modes for the System.Net.Sockets.Socket using the System.Net.Sockets.IOControlCode enumeration to specify control codes.

Listen(int)

Places a System.Net.Sockets.Socket in a listening state.

Poll(int, System.Net.Sockets.SelectMode) : bool

Determines the status of the System.Net.Sockets.Socket.

Receive(byte[]) : int

Receives data from a bound System.Net.Sockets.Socket into a receive buffer.

Receive(IList<ArraySegment<byte>>) : int

Receives data from a bound System.Net.Sockets.Socket into the list of receive buffers.

Receive(byte[], System.Net.Sockets.SocketFlags) : int

Receives data from a bound System.Net.Sockets.Socket into a receive buffer, using the specified System.Net.Sockets.SocketFlags.

Receive(IList<ArraySegment<byte>>, System.Net.Sockets.SocketFlags) : int

Receives data from a bound System.Net.Sockets.Socket into the list of receive buffers, using the specified System.Net.Sockets.SocketFlags.

Receive(byte[], int, System.Net.Sockets.SocketFlags) : int

Receives the specified number of bytes of data from a bound System.Net.Sockets.Socket into a receive buffer, using the specified System.Net.Sockets.SocketFlags.

Receive(IList<ArraySegment<byte>>, System.Net.Sockets.SocketFlags, out System.Net.Sockets.SocketError) : int
Documentation for this section has not yet been entered.
Receive(byte[], int, int, System.Net.Sockets.SocketFlags) : int

Receives the specified number of bytes from a bound System.Net.Sockets.Socket into the specified offset position of the receive buffer, using the specified System.Net.Sockets.SocketFlags.

Receive(byte[], int, int, System.Net.Sockets.SocketFlags, out System.Net.Sockets.SocketError) : int
Documentation for this section has not yet been entered.
ReceiveAsync(System.Net.Sockets.SocketAsyncEventArgs) : bool

Begins an asynchronous request to receive data from a connected System.Net.Sockets.Socket object.

ReceiveFrom(byte[], ref EndPoint) : int
Receives data from a socket and, for connectionless protocols, stores the endpoint associated with the socket that sent the data.
ReceiveFrom(byte[], System.Net.Sockets.SocketFlags, ref EndPoint) : int
Receives data from a socket and, for connectionless protocols, stores the endpoint associated with the socket that sent the data.
ReceiveFrom(byte[], int, System.Net.Sockets.SocketFlags, ref EndPoint) : int
Receives data from a socket and, for connectionless protocols, stores the endpoint associated with the socket that sent the data.
ReceiveFrom(byte[], int, int, System.Net.Sockets.SocketFlags, ref EndPoint) : int
Receives data from a socket and, for connectionless protocols, stores the endpoint associated with the socket that sent the data.
ReceiveFromAsync(System.Net.Sockets.SocketAsyncEventArgs) : bool

Begins to asynchronously receive data from a specified network device.

ReceiveMessageFrom(byte[], int, int, ref System.Net.Sockets.SocketFlags, ref EndPoint, out System.Net.Sockets.IPPacketInformation) : int
Documentation for this section has not yet been entered.
ReceiveMessageFromAsync(System.Net.Sockets.SocketAsyncEventArgs) : bool

Begins to asynchronously receive the specified number of bytes of data into the specified location in the data buffer, using the specified SocketAsyncEventArgs.SocketFlags, and stores the endpoint and packet information.

static
Select(IList, IList, IList, int)

Determines the status of one or more sockets.

Send(byte[]) : int

Sends data to a connected System.Net.Sockets.Socket.

Send(IList<ArraySegment<byte>>) : int

Sends the set of buffers in the list to a connected System.Net.Sockets.Socket.

Send(byte[], System.Net.Sockets.SocketFlags) : int

Sends data to a connected System.Net.Sockets.Socket using the specified System.Net.Sockets.SocketFlags.

Send(IList<ArraySegment<byte>>, System.Net.Sockets.SocketFlags) : int

Sends the set of buffers in the list to a connected System.Net.Sockets.Socket, using the specified System.Net.Sockets.SocketFlags.

Send(byte[], int, System.Net.Sockets.SocketFlags) : int

Sends the specified number of bytes of data to a connected System.Net.Sockets.Socket, using the specified System.Net.Sockets.SocketFlags.

Send(IList<ArraySegment<byte>>, System.Net.Sockets.SocketFlags, out System.Net.Sockets.SocketError) : int
Documentation for this section has not yet been entered.
Send(byte[], int, int, System.Net.Sockets.SocketFlags) : int

Sends the specified number of bytes of data to a connected System.Net.Sockets.Socket, starting at the specified offset, and using the specified System.Net.Sockets.SocketFlags.

Send(byte[], int, int, System.Net.Sockets.SocketFlags, out System.Net.Sockets.SocketError) : int
Documentation for this section has not yet been entered.
SendAsync(System.Net.Sockets.SocketAsyncEventArgs) : bool

Sends data asynchronously to a connected System.Net.Sockets.Socket object.

SendFile(string)

Sends the file fileName to a connected System.Net.Sockets.Socket object with the TransmitFileOptions.UseDefaultWorkerThread transmit flag.

SendFile(string, byte[], byte[], System.Net.Sockets.TransmitFileOptions)

Sends the file fileName and buffers of data to a connected System.Net.Sockets.Socket object using the specified System.Net.Sockets.TransmitFileOptions value.

SendPacketsAsync(System.Net.Sockets.SocketAsyncEventArgs) : bool

Sends a collection of files or in memory data buffers asynchronously to a connected System.Net.Sockets.Socket object.

SendTo(byte[], EndPoint) : int

Sends data to the specified endpoint.

SendTo(byte[], System.Net.Sockets.SocketFlags, EndPoint) : int

Sends data to a specific endpoint using the specified System.Net.Sockets.SocketFlags.

SendTo(byte[], int, System.Net.Sockets.SocketFlags, EndPoint) : int

Sends the specified number of bytes of data to the specified endpoint using the specified System.Net.Sockets.SocketFlags.

SendTo(byte[], int, int, System.Net.Sockets.SocketFlags, EndPoint) : int

Sends the specified number of bytes of data to the specified endpoint, starting at the specified location in the buffer, and using the specified System.Net.Sockets.SocketFlags.

SendToAsync(System.Net.Sockets.SocketAsyncEventArgs) : bool

Sends data asynchronously to a specific remote host.

SetSocketOption(System.Net.Sockets.SocketOptionLevel, System.Net.Sockets.SocketOptionName, bool)

Sets the specified System.Net.Sockets.Socket option to the specified bool value.

SetSocketOption(System.Net.Sockets.SocketOptionLevel, System.Net.Sockets.SocketOptionName, byte[])

Sets the specified System.Net.Sockets.Socket option to the specified value, represented as a byte array.

SetSocketOption(System.Net.Sockets.SocketOptionLevel, System.Net.Sockets.SocketOptionName, int)

Sets the specified System.Net.Sockets.Socket option to the specified integer value.

SetSocketOption(System.Net.Sockets.SocketOptionLevel, System.Net.Sockets.SocketOptionName, object)

Sets the specified System.Net.Sockets.Socket option to the specified value, represented as an object.

Shutdown(System.Net.Sockets.SocketShutdown)

Disables sends and receives on a System.Net.Sockets.Socket.

Protected Methods

Dispose(bool)

Releases the unmanaged resources used by the System.Net.Sockets.Socket, and optionally disposes of the managed resources.