xale-db 1.0
minimal SQL engine, written in c++
Loading...
Searching...
No Matches
Xale::Net::IListenerSocket Class Referenceabstract

Server-side socket: binds a port and produces per-client connections. More...

#include <IListenerSocket.h>

Inheritance diagram for Xale::Net::IListenerSocket:
Inheritance graph
Collaboration diagram for Xale::Net::IListenerSocket:
Collaboration graph

Public Member Functions

virtual ~IListenerSocket ()=default
virtual bool open (int port)=0
 Bind and start listening on the given port.
virtual std::unique_ptr< IClientConnectionacceptClient ()=0
 Block until a new client connects, then return a connection object.
virtual void close ()=0
 Close the listening socket.

Detailed Description

Server-side socket: binds a port and produces per-client connections.

Constructor & Destructor Documentation

◆ ~IListenerSocket()

virtual Xale::Net::IListenerSocket::~IListenerSocket ( )
virtualdefault

Member Function Documentation

◆ acceptClient()

virtual std::unique_ptr< IClientConnection > Xale::Net::IListenerSocket::acceptClient ( )
pure virtual

Block until a new client connects, then return a connection object.

Returns
Unique pointer to an IClientConnection, or nullptr on error

Implemented in Xale::Net::LinuxSSLListenerSocket.

◆ close()

virtual void Xale::Net::IListenerSocket::close ( )
pure virtual

Close the listening socket.

Implemented in Xale::Net::LinuxSSLListenerSocket.

◆ open()

virtual bool Xale::Net::IListenerSocket::open ( int port)
pure virtual

Bind and start listening on the given port.

Parameters
portTCP port to listen on
Returns
True on success

Implemented in Xale::Net::LinuxSSLListenerSocket.


The documentation for this class was generated from the following file: