IsListener

Description

Returns a boolean value indicating whether or not the specified socket is a listening socket.

Good to know: Use this to check if a socket handle is a listener.

Remarks

Call this method to start listening for a connection request on a particular port.

When a client attempts to connect to an application that has called the AddListener method, the listening application's ConnectionRequest event will fire, allowing the application to accept or reject the connection. Note that the return value of this method is the SocketHandle for the listening socket, and this handle must be used to close the socket (via the CloseSock method). If the call fails with a return value of INVALID_SOCKET (-1), use the LastSockErr property to get the error number (these are standard Winsock errors). Note that when this socket is closed, a ConnectionTerminated event will fire.

Prototype

BOOL IsListener(long SocketHandle)

Last updated