Socket Methods

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Namespace:   System.Net.Sockets
Assembly:  System (in System.dll)

NameDescription
System_CAPS_pubmethodAccept()

Creates a new Socket for a newly created connection.

System_CAPS_pubmethodAcceptAsync(SocketAsyncEventArgs)

Begins an asynchronous operation to accept an incoming connection attempt.

System_CAPS_pubmethodBeginAccept(AsyncCallback, Object)

Begins an asynchronous operation to accept an incoming connection attempt.

System_CAPS_pubmethodBeginAccept(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.

System_CAPS_pubmethodBeginAccept(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.

System_CAPS_pubmethodBeginConnect(EndPoint, AsyncCallback, Object)

Begins an asynchronous request for a remote host connection.

System_CAPS_pubmethodBeginConnect(IPAddress, Int32, AsyncCallback, Object)

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

System_CAPS_pubmethodBeginConnect(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.

System_CAPS_pubmethodBeginConnect(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.

System_CAPS_pubmethodBeginDisconnect(Boolean, AsyncCallback, Object)

Begins an asynchronous request to disconnect from a remote endpoint.

System_CAPS_pubmethodBeginReceive(Byte[], Int32, Int32, SocketFlags, AsyncCallback, Object)

Begins to asynchronously receive data from a connected Socket.

System_CAPS_pubmethodBeginReceive(Byte[], Int32, Int32, SocketFlags, SocketError, AsyncCallback, Object)

Begins to asynchronously receive data from a connected Socket.

System_CAPS_pubmethodBeginReceive(IList<ArraySegment<Byte>>, SocketFlags, AsyncCallback, Object)

Begins to asynchronously receive data from a connected Socket.

System_CAPS_pubmethodBeginReceive(IList<ArraySegment<Byte>>, SocketFlags, SocketError, AsyncCallback, Object)

Begins to asynchronously receive data from a connected Socket.

System_CAPS_pubmethodBeginReceiveFrom(Byte[], Int32, Int32, SocketFlags, EndPoint, AsyncCallback, Object)

Begins to asynchronously receive data from a specified network device.

System_CAPS_pubmethodBeginReceiveMessageFrom(Byte[], Int32, Int32, SocketFlags, EndPoint, AsyncCallback, Object)

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..

System_CAPS_pubmethodBeginSend(Byte[], Int32, Int32, SocketFlags, AsyncCallback, Object)

Sends data asynchronously to a connected Socket.

System_CAPS_pubmethodBeginSend(Byte[], Int32, Int32, SocketFlags, SocketError, AsyncCallback, Object)

Sends data asynchronously to a connected Socket.

System_CAPS_pubmethodBeginSend(IList<ArraySegment<Byte>>, SocketFlags, AsyncCallback, Object)

Sends data asynchronously to a connected Socket.

System_CAPS_pubmethodBeginSend(IList<ArraySegment<Byte>>, SocketFlags, SocketError, AsyncCallback, Object)

Sends data asynchronously to a connected Socket.

System_CAPS_pubmethodBeginSendFile(String, AsyncCallback, Object)

Sends the file fileName to a connected Socket object using the UseDefaultWorkerThread flag.

System_CAPS_pubmethodBeginSendFile(String, Byte[], Byte[], TransmitFileOptions, AsyncCallback, Object)

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

System_CAPS_pubmethodBeginSendTo(Byte[], Int32, Int32, SocketFlags, EndPoint, AsyncCallback, Object)

Sends data asynchronously to a specific remote host.

System_CAPS_pubmethodBind(EndPoint)

Associates a Socket with a local endpoint.

System_CAPS_pubmethodSystem_CAPS_staticCancelConnectAsync(SocketAsyncEventArgs)

Cancels an asynchronous request for a remote host connection.

System_CAPS_pubmethodClose()

Closes the Socket connection and releases all associated resources.

System_CAPS_pubmethodClose(Int32)

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

System_CAPS_pubmethodConnect(EndPoint)

Establishes a connection to a remote host.

System_CAPS_pubmethodConnect(IPAddress, Int32)

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

System_CAPS_pubmethodConnect(IPAddress[], Int32)

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

System_CAPS_pubmethodConnect(String, Int32)

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

System_CAPS_pubmethodConnectAsync(SocketAsyncEventArgs)

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

System_CAPS_pubmethodSystem_CAPS_staticConnectAsync(SocketType, ProtocolType, SocketAsyncEventArgs)

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

System_CAPS_pubmethodDisconnect(Boolean)

Closes the socket connection and allows reuse of the socket.

System_CAPS_pubmethodDisconnectAsync(SocketAsyncEventArgs)

Begins an asynchronous request to disconnect from a remote endpoint.

System_CAPS_pubmethodDispose()

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

System_CAPS_protmethodDispose(Boolean)

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

System_CAPS_pubmethodDuplicateAndClose(Int32)

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

System_CAPS_pubmethodEndAccept(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.

System_CAPS_pubmethodEndAccept(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.

System_CAPS_pubmethodEndAccept(IAsyncResult)

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

System_CAPS_pubmethodEndConnect(IAsyncResult)

Ends a pending asynchronous connection request.

System_CAPS_pubmethodEndDisconnect(IAsyncResult)

Ends a pending asynchronous disconnect request.

System_CAPS_pubmethodEndReceive(IAsyncResult)

Ends a pending asynchronous read.

System_CAPS_pubmethodEndReceive(IAsyncResult, SocketError)

Ends a pending asynchronous read.

System_CAPS_pubmethodEndReceiveFrom(IAsyncResult, EndPoint)

Ends a pending asynchronous read from a specific endpoint.

System_CAPS_pubmethodEndReceiveMessageFrom(IAsyncResult, SocketFlags, EndPoint, IPPacketInformation)

Ends a pending asynchronous read from a specific endpoint. This method also reveals more information about the packet than EndReceiveFrom.

System_CAPS_pubmethodEndSend(IAsyncResult)

Ends a pending asynchronous send.

System_CAPS_pubmethodEndSend(IAsyncResult, SocketError)

Ends a pending asynchronous send.

System_CAPS_pubmethodEndSendFile(IAsyncResult)

Ends a pending asynchronous send of a file.

System_CAPS_pubmethodEndSendTo(IAsyncResult)

Ends a pending asynchronous send to a specific location.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Frees resources used by the Socket class.(Overrides Object.Finalize().)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetSocketOption(SocketOptionLevel, SocketOptionName)

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

System_CAPS_pubmethodGetSocketOption(SocketOptionLevel, SocketOptionName, Byte[])

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

System_CAPS_pubmethodGetSocketOption(SocketOptionLevel, SocketOptionName, Int32)

Returns the value of the specified Socket option in an array.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodIOControl(Int32, Byte[], Byte[])

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

System_CAPS_pubmethodIOControl(IOControlCode, Byte[], Byte[])

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

System_CAPS_pubmethodListen(Int32)

Places a Socket in a listening state.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodPoll(Int32, SelectMode)

Determines the status of the Socket.

System_CAPS_pubmethodReceive(Byte[])

Receives data from a bound Socket into a receive buffer.

System_CAPS_pubmethodReceive(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.

System_CAPS_pubmethodReceive(Byte[], Int32, Int32, SocketFlags, SocketError)

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

System_CAPS_pubmethodReceive(Byte[], Int32, SocketFlags)

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

System_CAPS_pubmethodReceive(Byte[], SocketFlags)

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

System_CAPS_pubmethodReceive(IList<ArraySegment<Byte>>)

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

System_CAPS_pubmethodReceive(IList<ArraySegment<Byte>>, SocketFlags)

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

System_CAPS_pubmethodReceive(IList<ArraySegment<Byte>>, SocketFlags, SocketError)

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

System_CAPS_pubmethodReceiveAsync(SocketAsyncEventArgs)

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

System_CAPS_pubmethodReceiveFrom(Byte[], EndPoint)

Receives a datagram into the data buffer and stores the endpoint.

System_CAPS_pubmethodReceiveFrom(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.

System_CAPS_pubmethodReceiveFrom(Byte[], Int32, SocketFlags, EndPoint)

Receives the specified number of bytes into the data buffer, using the specified SocketFlags, and stores the endpoint.

System_CAPS_pubmethodReceiveFrom(Byte[], SocketFlags, EndPoint)

Receives a datagram into the data buffer, using the specified SocketFlags, and stores the endpoint.

System_CAPS_pubmethodReceiveFromAsync(SocketAsyncEventArgs)

Begins to asynchronously receive data from a specified network device.

System_CAPS_pubmethodReceiveMessageFrom(Byte[], Int32, Int32, SocketFlags, EndPoint, IPPacketInformation)

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.

System_CAPS_pubmethodReceiveMessageFromAsync(SocketAsyncEventArgs)

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.

System_CAPS_pubmethodSystem_CAPS_staticSelect(IList, IList, IList, Int32)

Determines the status of one or more sockets.

System_CAPS_pubmethodSend(Byte[])

Sends data to a connected Socket.

System_CAPS_pubmethodSend(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.

System_CAPS_pubmethodSend(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

System_CAPS_pubmethodSend(Byte[], Int32, SocketFlags)

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

System_CAPS_pubmethodSend(Byte[], SocketFlags)

Sends data to a connected Socket using the specified SocketFlags.

System_CAPS_pubmethodSend(IList<ArraySegment<Byte>>)

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

System_CAPS_pubmethodSend(IList<ArraySegment<Byte>>, SocketFlags)

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

System_CAPS_pubmethodSend(IList<ArraySegment<Byte>>, SocketFlags, SocketError)

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

System_CAPS_pubmethodSendAsync(SocketAsyncEventArgs)

Sends data asynchronously to a connected Socket object.

System_CAPS_pubmethodSendFile(String)

Sends the file fileName to a connected Socket object with the UseDefaultWorkerThread transmit flag.

System_CAPS_pubmethodSendFile(String, Byte[], Byte[], TransmitFileOptions)

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

System_CAPS_pubmethodSendPacketsAsync(SocketAsyncEventArgs)

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

System_CAPS_pubmethodSendTo(Byte[], EndPoint)

Sends data to the specified endpoint.

System_CAPS_pubmethodSendTo(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.

System_CAPS_pubmethodSendTo(Byte[], Int32, SocketFlags, EndPoint)

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

System_CAPS_pubmethodSendTo(Byte[], SocketFlags, EndPoint)

Sends data to a specific endpoint using the specified SocketFlags.

System_CAPS_pubmethodSendToAsync(SocketAsyncEventArgs)

Sends data asynchronously to a specific remote host.

System_CAPS_pubmethodSetIPProtectionLevel(IPProtectionLevel)

Set the IP protection level on a socket.

System_CAPS_pubmethodSetSocketOption(SocketOptionLevel, SocketOptionName, Boolean)

Sets the specified Socket option to the specified Boolean value.

System_CAPS_pubmethodSetSocketOption(SocketOptionLevel, SocketOptionName, Byte[])

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

System_CAPS_pubmethodSetSocketOption(SocketOptionLevel, SocketOptionName, Int32)

Sets the specified Socket option to the specified integer value.

System_CAPS_pubmethodSetSocketOption(SocketOptionLevel, SocketOptionName, Object)

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

System_CAPS_pubmethodShutdown(SocketShutdown)

Disables sends and receives on a Socket.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubmethodAcceptAsync()

Overloaded. Performs an asynchronous operation on to accept an incoming connection attempt on the socket.(Defined by SocketTaskExtensions.)

System_CAPS_pubmethodAcceptAsync(Socket)

Overloaded. Performs an asynchronous operation on to accept an incoming connection attempt on the socket.(Defined by SocketTaskExtensions.)

System_CAPS_pubmethodConnectAsync(EndPoint)

Overloaded. Establishes a connection to a remote host.(Defined by SocketTaskExtensions.)

System_CAPS_pubmethodConnectAsync(IPAddress, Int32)

Overloaded. Establishes a connection to a remote host. The host is specified by an IP address and a port number.(Defined by SocketTaskExtensions.)

System_CAPS_pubmethodConnectAsync(IPAddress[], Int32)

Overloaded. Establishes a connection to a remote host. The host is specified by an array of IP addresses and a port number.(Defined by SocketTaskExtensions.)

System_CAPS_pubmethodConnectAsync(String, Int32)

Overloaded. Establishes a connection to a remote host. The host is specified by a host name and a port number.(Defined by SocketTaskExtensions.)

System_CAPS_pubmethodReceiveAsync(ArraySegment<Byte>, SocketFlags)

Overloaded. Receives data from a connected socket.(Defined by SocketTaskExtensions.)

System_CAPS_pubmethodReceiveAsync(IList<ArraySegment<Byte>>, SocketFlags)

Overloaded. Receives data from a connected socket.(Defined by SocketTaskExtensions.)

System_CAPS_pubmethodReceiveFromAsync(ArraySegment<Byte>, SocketFlags, EndPoint)

Receive data from a specified network device.(Defined by SocketTaskExtensions.)

System_CAPS_pubmethodReceiveMessageFromAsync(ArraySegment<Byte>, 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 and packet information.(Defined by SocketTaskExtensions.)

System_CAPS_pubmethodSendAsync(ArraySegment<Byte>, SocketFlags)

Overloaded. Sends data to a connected socket.(Defined by SocketTaskExtensions.)

System_CAPS_pubmethodSendAsync(IList<ArraySegment<Byte>>, SocketFlags)

Overloaded. Sends data to a connected socket.(Defined by SocketTaskExtensions.)

System_CAPS_pubmethodSendToAsync(ArraySegment<Byte>, SocketFlags, EndPoint)

Sends data asynchronously to a specific remote host.(Defined by SocketTaskExtensions.)

Return to top
Show: