Socket Methods
.NET Framework 4
The Socket type exposes the following members.
| Name | Description | |
|---|---|---|
|
Accept | Creates a new Socket for a newly created connection. |
|
AcceptAsync | Begins an asynchronous operation to accept an incoming connection attempt. |
|
BeginAccept(AsyncCallback, Object) | Begins an asynchronous operation to accept an incoming connection attempt. |
|
BeginAccept(Int32, AsyncCallback, Object) | Begins an asynchronous operation to accept an incoming connection attempt and receives the first block of data sent by the client application. |
|
BeginAccept(Socket, Int32, AsyncCallback, Object) | 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) | Begins an asynchronous request for a remote host connection. |
|
BeginConnect(IPAddress, Int32, AsyncCallback, Object) | Begins an asynchronous request for a remote host connection. The host is specified by an IPAddress and a port number. |
|
BeginConnect(IPAddress[], Int32, AsyncCallback, Object) | Begins an asynchronous request for a remote host connection. The host is specified by an IPAddress array and a port number. |
|
BeginConnect(String, Int32, AsyncCallback, Object) | Begins an asynchronous request for a remote host connection. The host is specified by a host name and a port number. |
|
BeginDisconnect | Begins an asynchronous request to disconnect from a remote endpoint. |
|
BeginReceive(IList<ArraySegment<Byte>>, SocketFlags, AsyncCallback, Object) | Begins to asynchronously receive data from a connected Socket. |
|
BeginReceive(IList<ArraySegment<Byte>>, SocketFlags, SocketError, AsyncCallback, Object) | Begins to asynchronously receive data from a connected Socket. |
|
BeginReceive(Byte[], Int32, Int32, SocketFlags, AsyncCallback, Object) | Begins to asynchronously receive data from a connected Socket. |
|
BeginReceive(Byte[], Int32, Int32, SocketFlags, SocketError, AsyncCallback, Object) | Begins to asynchronously receive data from a connected Socket. |
|
BeginReceiveFrom | Begins to asynchronously receive data from a specified network device. |
|
BeginReceiveMessageFrom | Begins to asynchronously receive the specified number of bytes of data into the specified location of the data buffer, using the specified SocketFlags, and stores the endpoint and packet information.. |
|
BeginSend(IList<ArraySegment<Byte>>, SocketFlags, AsyncCallback, Object) | Sends data asynchronously to a connected Socket. |
|
BeginSend(IList<ArraySegment<Byte>>, SocketFlags, SocketError, AsyncCallback, Object) | Sends data asynchronously to a connected Socket. |
|
BeginSend(Byte[], Int32, Int32, SocketFlags, AsyncCallback, Object) | Sends data asynchronously to a connected Socket. |
|
BeginSend(Byte[], Int32, Int32, SocketFlags, SocketError, AsyncCallback, Object) | Sends data asynchronously to a connected Socket. |
|
BeginSendFile(String, AsyncCallback, Object) | Sends the file fileName to a connected Socket object using the UseDefaultWorkerThread flag. |
|
BeginSendFile(String, Byte[], Byte[], TransmitFileOptions, AsyncCallback, Object) | Sends a file and buffers of data asynchronously to a connected Socket object. |
|
BeginSendTo | Sends data asynchronously to a specific remote host. |
|
Bind | Associates a Socket with a local endpoint. |
|
CancelConnectAsync | Cancels an asynchronous request for a remote host connection. |
|
Close() | Closes the Socket connection and releases all associated resources. |
|
Close(Int32) | Closes the 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, Int32) | Establishes a connection to a remote host. The host is specified by an IP address and a port number. |
|
Connect(IPAddress[], Int32) | Establishes a connection to a remote host. The host is specified by an array of IP addresses and a port number. |
|
Connect(String, Int32) | Establishes a connection to a remote host. The host is specified by a host name and a port number. |
|
ConnectAsync(SocketAsyncEventArgs) | Begins an asynchronous request for a remote host connection. |
|
ConnectAsync(SocketType, ProtocolType, SocketAsyncEventArgs) | Begins an asynchronous request for a remote host connection. |
|
Disconnect | Closes the socket connection and allows reuse of the socket. |
|
DisconnectAsync | Begins an asynchronous request to disconnect from a remote endpoint. |
|
Dispose() | Releases all resources used by the current instance of the Socket class. |
|
Dispose(Boolean) | Releases the unmanaged resources used by the Socket, and optionally disposes of the managed resources. |
|
DuplicateAndClose | Duplicates the socket reference for the target process, and closes the socket for this process. |
|
EndAccept(IAsyncResult) | Asynchronously accepts an incoming connection attempt and creates a new Socket to handle remote host communication. |
|
EndAccept(Byte[], IAsyncResult) | Asynchronously accepts an incoming connection attempt and creates a new Socket object to handle remote host communication. This method returns a buffer that contains the initial data transferred. |
|
EndAccept(Byte[], Int32, IAsyncResult) | Asynchronously accepts an incoming connection attempt and creates a new Socket object to handle remote host communication. This method returns a buffer that contains the initial data and the number of bytes transferred. |
|
EndConnect | Ends a pending asynchronous connection request. |
|
EndDisconnect | Ends a pending asynchronous disconnect request. |
|
EndReceive(IAsyncResult) | Ends a pending asynchronous read. |
|
EndReceive(IAsyncResult, SocketError) | Ends a pending asynchronous read. |
|
EndReceiveFrom | Ends a pending asynchronous read from a specific endpoint. |
|
EndReceiveMessageFrom | Ends a pending asynchronous read from a specific endpoint. This method also reveals more information about the packet than EndReceiveFrom. |
|
EndSend(IAsyncResult) | Ends a pending asynchronous send. |
|
EndSend(IAsyncResult, SocketError) | Ends a pending asynchronous send. |
|
EndSendFile | Ends a pending asynchronous send of a file. |
|
EndSendTo | Ends a pending asynchronous send to a specific location. |
|
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
|
Finalize | Frees resources used by the Socket class. (Overrides Object.Finalize().) |
|
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
|
GetSocketOption(SocketOptionLevel, SocketOptionName) | Returns the value of a specified Socket option, represented as an object. |
|
GetSocketOption(SocketOptionLevel, SocketOptionName, Byte[]) | Returns the specified Socket option setting, represented as a byte array. |
|
GetSocketOption(SocketOptionLevel, SocketOptionName, Int32) | Returns the value of the specified Socket option in an array. |
|
GetType | Gets the Type of the current instance. (Inherited from Object.) |
|
IOControl(Int32, Byte[], Byte[]) | Sets low-level operating modes for the Socket using numerical control codes. |
|
IOControl(IOControlCode, Byte[], Byte[]) | Sets low-level operating modes for the Socket using the IOControlCode enumeration to specify control codes. |
|
Listen | Places a Socket in a listening state. |
|
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
|
Poll | Determines the status of the Socket. |
|
Receive(IList<ArraySegment<Byte>>) | Receives data from a bound Socket into the list of receive buffers. |
|
Receive(Byte[]) | Receives data from a bound Socket into a receive buffer. |
|
Receive(IList<ArraySegment<Byte>>, SocketFlags) | Receives data from a bound Socket into the list of receive buffers, using the specified SocketFlags. |
|
Receive(Byte[], SocketFlags) | Receives data from a bound Socket into a receive buffer, using the specified SocketFlags. |
|
Receive(IList<ArraySegment<Byte>>, SocketFlags, SocketError) | Receives data from a bound Socket into the list of receive buffers, using the specified SocketFlags. |
|
Receive(Byte[], Int32, SocketFlags) | Receives the specified number of bytes of data from a bound Socket into a receive buffer, using the specified SocketFlags. |
|
Receive(Byte[], Int32, Int32, SocketFlags) | Receives the specified number of bytes from a bound Socket into the specified offset position of the receive buffer, using the specified SocketFlags. |
|
Receive(Byte[], Int32, Int32, SocketFlags, SocketError) | Receives data from a bound Socket into a receive buffer, using the specified SocketFlags. |
|
ReceiveAsync | Begins an asynchronous request to receive data from a connected Socket object. |
|
ReceiveFrom(Byte[], EndPoint) | Receives a datagram into the data buffer and stores the endpoint. |
|
ReceiveFrom(Byte[], SocketFlags, EndPoint) | Receives a datagram into the data buffer, using the specified SocketFlags, and stores the endpoint. |
|
ReceiveFrom(Byte[], Int32, SocketFlags, EndPoint) | Receives the specified number of bytes into the data buffer, using the specified SocketFlags, and stores the endpoint. |
|
ReceiveFrom(Byte[], Int32, Int32, SocketFlags, EndPoint) | Receives the specified number of bytes of data into the specified location of the data buffer, using the specified SocketFlags, and stores the endpoint. |
|
ReceiveFromAsync | Begins to asynchronously receive data from a specified network device. |
|
ReceiveMessageFrom | Receives the specified number of bytes of data into the specified location of the data buffer, using the specified SocketFlags, and stores the endpoint and packet information. |
|
ReceiveMessageFromAsync | 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. |
|
Select | Determines the status of one or more sockets. |
|
Send(IList<ArraySegment<Byte>>) | Sends the set of buffers in the list to a connected Socket. |
|
Send(Byte[]) | Sends data to a connected Socket. |
|
Send(IList<ArraySegment<Byte>>, SocketFlags) | Sends the set of buffers in the list to a connected Socket, using the specified SocketFlags. |
|
Send(Byte[], SocketFlags) | Sends data to a connected Socket using the specified SocketFlags. |
|
Send(IList<ArraySegment<Byte>>, SocketFlags, SocketError) | Sends the set of buffers in the list to a connected Socket, using the specified SocketFlags. |
|
Send(Byte[], Int32, SocketFlags) | Sends the specified number of bytes of data to a connected Socket, using the specified SocketFlags. |
|
Send(Byte[], Int32, Int32, SocketFlags) | Sends the specified number of bytes of data to a connected Socket, starting at the specified offset, and using the specified SocketFlags. |
|
Send(Byte[], Int32, Int32, SocketFlags, SocketError) | Sends the specified number of bytes of data to a connected Socket, starting at the specified offset, and using the specified SocketFlags |
|
SendAsync | Sends data asynchronously to a connected Socket object. |
|
SendFile(String) | Sends the file fileName to a connected Socket object with the UseDefaultWorkerThread transmit flag. |
|
SendFile(String, Byte[], Byte[], TransmitFileOptions) | Sends the file fileName and buffers of data to a connected Socket object using the specified TransmitFileOptions value. |
|
SendPacketsAsync | Sends a collection of files or in memory data buffers asynchronously to a connected Socket object. |
|
SendTo(Byte[], EndPoint) | Sends data to the specified endpoint. |
|
SendTo(Byte[], SocketFlags, EndPoint) | Sends data to a specific endpoint using the specified SocketFlags. |
|
SendTo(Byte[], Int32, SocketFlags, EndPoint) | Sends the specified number of bytes of data to the specified endpoint using the specified SocketFlags. |
|
SendTo(Byte[], Int32, Int32, SocketFlags, EndPoint) | Sends the specified number of bytes of data to the specified endpoint, starting at the specified location in the buffer, and using the specified SocketFlags. |
|
SendToAsync | Sends data asynchronously to a specific remote host. |
|
SetIPProtectionLevel | Set the IP protection level on a socket. |
|
SetSocketOption(SocketOptionLevel, SocketOptionName, Boolean) | Sets the specified Socket option to the specified Boolean value. |
|
SetSocketOption(SocketOptionLevel, SocketOptionName, Byte[]) | Sets the specified Socket option to the specified value, represented as a byte array. |
|
SetSocketOption(SocketOptionLevel, SocketOptionName, Int32) | Sets the specified Socket option to the specified integer value. |
|
SetSocketOption(SocketOptionLevel, SocketOptionName, Object) | Sets the specified Socket option to the specified value, represented as an object. |
|
Shutdown | Disables sends and receives on a Socket. |
|
ToString | Returns a string that represents the current object. (Inherited from Object.) |