Content


NTL
Core
IServerSocketListener

IServerSocketListener



Describes server socket listener which can be used to receive callbacks from server socket.

You can find more information in comments below.

class IServerSocketListener
{
public:
    virtual void NotifyOnError(IServerSocket *sender, const ISocket::ErrorType error) = 0; // Called when error happened during listen process. Listen stops after error
    virtual void NotifyOnConnect(IServerSocket *sender, bool &accept) = 0; // Called at first stage of client connection. Set accept = false to prevent connection. accept = false by default. It is a good place to check whether the maximum connections are already exists
    virtual void NotifyOnConnect(IServerSocket *sender, const AnsiString &ip, const int port, bool &accept) = 0; // Called at second stage of client connection. Set accept = false to prevent connection. accept = true by default. This is a good place to check whether connection is allowed for the client with specified ip address
    virtual void NotifyOnConnect(IServerSocket *sender, IClientSocket *socket) = 0; // Called at third, final, stage of client connection. The client is already connected and a new socket, responsible for communication with it, is provided
};
Namespace: nitisa
Include: Nitisa/Interfaces/IServerSocketListener.h