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

Method ServerConnection

MonaServer/sources/ServerConnection.cpp:29–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28
29ServerConnection::ServerConnection(const SocketAddress& address,const SocketManager& manager,const char* query) : address(address), _pClient(new TCPClient(manager)), _connected(false), isTarget(true),
30 _onError([this](const Exception& ex) { _ex=ex; }),
31 _onData([this](PoolBuffer& pBuffer) { return onData(pBuffer); }),
32 _onDisconnection([this](TCPClient& client, const SocketAddress&) { onDisconnection(); }) {
33
34 if (query)
35 Util::UnpackQuery(query,_properties);
36
37 _pClient->OnError::subscribe(_onError);
38 _pClient->OnDisconnection::subscribe(_onDisconnection);
39 _pClient->OnData::subscribe(_onData);
40}
41
42ServerConnection::ServerConnection(const SocketAddress& address,SocketFile& file,const SocketManager& manager) : address(address), _pClient(new TCPClient(address,file,manager)), _connected(false), isTarget(false),
43 _onError([this](const Exception& ex) { _ex=ex; }),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected