Accept Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Creates a new Socket for a newly created connection.

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

'Declaration
Public Function Accept As Socket

Return Value

Type: System.Net.Sockets..::..Socket
A Socket for a newly created connection.

Accept synchronously extracts the first pending connection request from the connection request queue of the listening socket, and then creates and returns a new Socket. You cannot use this returned Socket to accept any additional connections from the connection queue. However, you can call the RemoteEndPoint method of the returned Socket to identify the remote host's network address and port number.

NoteNote

Before calling the Accept method, you must first call the Listen method to listen for and queue incoming connection requests.

Show: