SocketTaskExtensions.AcceptAsync Method

Definition

Overloads

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.

AcceptAsync(Socket)

Performs an asynchronous operation on to accept an incoming connection attempt on the socket.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<System::Net::Sockets::Socket ^> ^ AcceptAsync(System::Net::Sockets::Socket ^ socket);
public static System.Threading.Tasks.Task<System.Net.Sockets.Socket> AcceptAsync (this System.Net.Sockets.Socket socket);
static member AcceptAsync : System.Net.Sockets.Socket -> System.Threading.Tasks.Task<System.Net.Sockets.Socket>
<Extension()>
Public Function AcceptAsync (socket As Socket) As Task(Of Socket)

Parameters

socket
Socket

The socket that is listening for connections.

Returns

Task<Socket>

An asynchronous task that completes with a Socket to handle communication with the remote host.

AcceptAsync(Socket, Socket)

Performs an asynchronous operation on to accept an incoming connection attempt on the socket.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<System::Net::Sockets::Socket ^> ^ AcceptAsync(System::Net::Sockets::Socket ^ socket, System::Net::Sockets::Socket ^ acceptSocket);
public static System.Threading.Tasks.Task<System.Net.Sockets.Socket> AcceptAsync (this System.Net.Sockets.Socket socket, System.Net.Sockets.Socket acceptSocket);
static member AcceptAsync : System.Net.Sockets.Socket * System.Net.Sockets.Socket -> System.Threading.Tasks.Task<System.Net.Sockets.Socket>
<Extension()>
Public Function AcceptAsync (socket As Socket, acceptSocket As Socket) As Task(Of Socket)

Parameters

socket
Socket

The socket that is listening for incoming connections.

acceptSocket
Socket

The accepted Socket object. This value may be null.

Returns

Task<Socket>

An asynchronous task that completes with a Socket to handle communication with the remote host.

Applies to