99 bool _listening =
false;
101 int _maxPending = 50;
Lightweight error code wrapper for the promeki library.
Definition error.h:39
Dynamic array container wrapping std::vector.
Definition list.h:40
Base object for promeki.
Definition objectbase.h:129
ObjectBase * parent() const
Returns the parent object, if one. nullptr if none.
Definition objectbase.h:258
Network address with port number.
Definition socketaddress.h:50
TCP server that listens for incoming connections.
Definition tcpserver.h:36
bool isListening() const
Returns true if the server is listening.
Definition tcpserver.h:60
void setMaxPendingConnections(int count)
Sets the maximum number of pending connections.
Definition tcpserver.h:92
Error waitForNewConnection(unsigned int timeoutMs=0)
Blocks until a new connection arrives or timeout.
void close()
Stops listening and closes the server socket.
TcpServer(ObjectBase *parent=nullptr)
Constructs a TcpServer.
~TcpServer() override
Destructor. Closes the server if listening.
SocketAddress serverAddress() const
Returns the address the server is listening on.
Definition tcpserver.h:63
Error listen(const SocketAddress &address, int backlog=50)
Starts listening for connections.
TcpSocket * nextPendingConnection()
Returns the next accepted connection.
bool hasPendingConnections() const
Returns true if there are pending connections.
PROMEKI_SIGNAL(newConnection)
Emitted when a new connection is available.
Stream-oriented TCP socket.
Definition tcpsocket.h:35
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19