| 26 | namespace Mona { |
| 27 | |
| 28 | TCPServer::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 | |
| 42 | TCPServer::~TCPServer() { |
| 43 | _socket.OnReadable::unsubscribe(onReadable); |
nothing calls this directly
no test coverage detected