SocketAsyncEventArgs.AcceptSocket 属性

定义

获取或设置要使用的套接字或创建用于接受与异步套接字方法的连接的套接字。Gets or sets the socket to use or the socket created for accepting a connection with an asynchronous socket method.

public:
 property System::Net::Sockets::Socket ^ AcceptSocket { System::Net::Sockets::Socket ^ get(); void set(System::Net::Sockets::Socket ^ value); };
public System.Net.Sockets.Socket AcceptSocket { get; set; }
member this.AcceptSocket : System.Net.Sockets.Socket with get, set
Public Property AcceptSocket As Socket

属性值

要使用的 Socket 或者创建用于接受与异步套接字方法的连接的套接字。The Socket to use or the socket created for accepting a connection with an asynchronous socket method.

注解

此属性可用于提供已创建的、将用于异步套接字接受操作的 SocketThis property can be used to provide an already created Socket that will be used for an asynchronous socket accept operation. 在接受操作完成后,它是表示接受的连接的套接字。Upon completion of the accept operation, it is the socket representing the accepted connection. 如果在调用 Socket.AcceptAsync 方法之前未提供(设置为 null),则将自动创建新的套接字,并使用此属性在完成回调中访问。If not supplied (set to null) before calling the Socket.AcceptAsync method, a new socket will be created automatically and be accessible in the completion callback with this property.

适用于

另请参阅