SocketTaskExtensions 类

定义

此类包含 Socket 类的扩展方法。This class contains extension methods to the Socket class.

public ref class SocketTaskExtensions abstract sealed
public static class SocketTaskExtensions
type SocketTaskExtensions = class
Public Module SocketTaskExtensions
继承
SocketTaskExtensions

方法

AcceptAsync(Socket)

执行异步操作,接受套接字上的传入连接尝试。Performs an asynchronous operation on to accept an incoming connection attempt on the socket.

AcceptAsync(Socket, Socket)

执行异步操作,接受套接字上的传入连接尝试。Performs an asynchronous operation on to accept an incoming connection attempt on the socket.

ConnectAsync(Socket, EndPoint)

与远程主机建立连接。Establishes a connection to a remote host.

ConnectAsync(Socket, IPAddress, Int32)

与远程主机建立连接。Establishes a connection to a remote host. 主机由 IP 地址和端口号指定。The host is specified by an IP address and a port number.

ConnectAsync(Socket, IPAddress[], Int32)

与远程主机建立连接。Establishes a connection to a remote host. 主机由 IP 地址数组和端口号指定。The host is specified by an array of IP addresses and a port number.

ConnectAsync(Socket, String, Int32)

与远程主机建立连接。Establishes a connection to a remote host. 主机由主机名和端口号指定。The host is specified by a host name and a port number.

ReceiveAsync(Socket, ArraySegment<Byte>, SocketFlags)

接收连接的套接字发出的数据。Receives data from a connected socket.

ReceiveAsync(Socket, IList<ArraySegment<Byte>>, SocketFlags)

接收连接的套接字发出的数据。Receives data from a connected socket.

ReceiveAsync(Socket, Memory<Byte>, SocketFlags, CancellationToken)

接收连接的套接字发出的数据。Receives data from a connected socket.

ReceiveFromAsync(Socket, ArraySegment<Byte>, SocketFlags, EndPoint)

接收来自指定网络设备的数据。Receives data from a specified network device.

ReceiveMessageFromAsync(Socket, ArraySegment<Byte>, SocketFlags, EndPoint)

使用指定的 SocketFlags 将指定字节数的数据接收到指定的数据缓冲区位置,并存储终结点和数据包信息。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.

SendAsync(Socket, ArraySegment<Byte>, SocketFlags)

将数据发送到连接的套接字。Sends data to a connected socket.

SendAsync(Socket, IList<ArraySegment<Byte>>, SocketFlags)

将数据发送到连接的套接字。Sends data to a connected socket.

SendAsync(Socket, ReadOnlyMemory<Byte>, SocketFlags, CancellationToken)

将数据发送到连接的套接字。Sends data to a connected socket.

SendToAsync(Socket, ArraySegment<Byte>, SocketFlags, EndPoint)

以异步方式将数据发送到特定远程主机。Sends data asynchronously to a specific remote host.

适用于