29 #ifndef Pt_Net_TcpServer_h
30 #define Pt_Net_TcpServer_h
32 #include <Pt/Net/Api.h>
33 #include <Pt/System/Selectable.h>
34 #include <Pt/Signal.h>
67 {
return _deferAccept; }
84 { _backlog = backlog; }
140 {
return _connectionPending; }
148 const TcpServerImpl& impl()
const
152 TcpServerImpl& impl()
157 virtual void onAttach(System::EventLoop& loop);
160 virtual void onDetach(System::EventLoop& loop);
163 virtual void onCancel();
166 virtual bool onRun();
169 System::EventLoop* _loop;
170 TcpServerImpl* _impl;
171 Signal<TcpServer&> _connectionPending;
178 #endif // Pt_Net_TcpServer_h
int backlog() const
Returns the accept backlog size.
Definition: TcpServer.h:78
TCP server options.
Definition: TcpServer.h:43
Signal< TcpServer & > & connectionPending()
Notifies that a connection was accepted.
Definition: TcpServer.h:139
void setDeferAccept(int n)
Defer accept until data arrives.
Definition: TcpServer.h:73
Dispatches operations through an event loop.
Definition: Selectable.h:44
int acceptDeferred() const
Returns the max time for data to arrive.
Definition: TcpServer.h:66
Multicast Signal to call multiple slots.
Definition: Signal.h:109
Represents a Network Host.
Definition: Endpoint.h:46
Thread-safe event loop supporting I/O multiplexing and Timers.
Definition: EventLoop.h:72
uint_type uint32_t
Unsigned 32-bit integer type.
Definition: Types.h:42
System::EventLoop * loop() const
Returns the parent event loop.
Definition: TcpServer.h:144
void setBacklog(int backlog)
Sets the accept backlog size.
Definition: TcpServer.h:83
TCP server socket.
Definition: TcpServer.h:99