MCPcopy Create free account
hub / github.com/MonaSolutions/MonaServer / TCPServer

Method TCPServer

MonaBase/sources/TCPServer.cpp:28–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace Mona {
27
28TCPServer::TCPServer(const SocketManager& manager) : _running(false),_socket(manager) {
29
30 onReadable = [this](Exception& ex,UInt32 available) {
31 SocketAddress address;
32 SocketFile file(_socket.acceptConnection(ex,address));
33 if (!file)
34 return;
35 OnConnection::raise(ex,address,file);
36 };
37
38 _socket.OnError::subscribe(*this);
39 _socket.OnReadable::subscribe(onReadable);
40}
41
42TCPServer::~TCPServer() {
43 _socket.OnReadable::unsubscribe(onReadable);

Callers

nothing calls this directly

Calls 1

acceptConnectionMethod · 0.45

Tested by

no test coverage detected