Mentalis.org Security Library documentation

SecureTcpListener.AcceptSocket Method 

Accepts a pending connection request.

[Visual Basic]
Overridable Public Function AcceptSocket() As SecureSocket
[C#]
public virtual SecureSocket AcceptSocket();

Return Value

A SecureSocket used to send and receive data.

Remarks

AcceptSocket returns a SecureSocket that you can use to send and receive data. This SecureSocket is initialized with the IP address and port number of the remote machine. You can use any of the Send and Receive methods available in the Socket class to communicate with the remote machine.
Note When you finish using the Socket, be sure to call its Close method.
Note If your application is relatively simple, consider using the AcceptTcpClient method rather than AcceptSocket. SecureTcpClient provides you with simple methods for sending and receiving data over a network.

Exceptions

Exception TypeCondition
InvalidOperationExceptionThe listener has not been started with a call to Start.
SocketExceptionAn operating system error occurs while accessing the SecureSocket.
SecurityExceptionUnable to create the SSPI credentials.

See Also

SecureTcpListener Class | SecureTcpListener Members | Org.Mentalis.Security.Ssl Namespace