xale-db 1.0
minimal SQL engine, written in c++
Loading...
Searching...
No Matches
IListenerSocket.h
Go to the documentation of this file.
1#ifndef NET_I_LISTENER_SOCKET_H
2#define NET_I_LISTENER_SOCKET_H
3
5
6#include <memory>
7#include <vector>
8#include <cstdint>
9
10namespace Xale::Net
11{
16 {
17 public:
18 virtual ~IListenerSocket() = default;
19
25 virtual bool open(int port) = 0;
26
31 virtual std::unique_ptr<IClientConnection> acceptClient() = 0;
32
36 virtual void close() = 0;
37 };
38}
39
40#endif // NET_I_LISTENER_SOCKET_H
Server-side socket: binds a port and produces per-client connections.
Definition IListenerSocket.h:16
virtual ~IListenerSocket()=default
virtual bool open(int port)=0
Bind and start listening on the given port.
virtual void close()=0
Close the listening socket.
virtual std::unique_ptr< IClientConnection > acceptClient()=0
Block until a new client connects, then return a connection object.
Definition IPacket.h:8