| 147 | }; |
| 148 | |
| 149 | Service::Service() |
| 150 | { |
| 151 | SeedRpcContexts = 0; |
| 152 | autoReconnect = false; |
| 153 | autoReconnectDelay = 0; |
| 154 | |
| 155 | SHandshake sHandshake; |
| 156 | AddProtocolFactory(sHandshake.TypeId(), Zeze::Net::Service::ProtocolFactoryHandle( |
| 157 | []() { return new SHandshake(); }, std::bind(&Service::ProcessSHandshake, this, std::placeholders::_1))); |
| 158 | SHandshake0 sHandshake0; |
| 159 | AddProtocolFactory(sHandshake0.TypeId(), Zeze::Net::Service::ProtocolFactoryHandle( |
| 160 | []() { return new SHandshake0(); }, std::bind(&Service::ProcessSHandshake0, this, std::placeholders::_1))); |
| 161 | KeepAlive keepAlive; |
| 162 | if (ProtocolFactory.find(keepAlive.TypeId()) == ProtocolFactory.end()) |
| 163 | { |
| 164 | AddProtocolFactory(keepAlive.TypeId(), Zeze::Net::Service::ProtocolFactoryHandle( |
| 165 | []() { return new KeepAlive(); }, std::bind(&Service::ProcessKeepAliveRequest, this, std::placeholders::_1))); |
| 166 | } |
| 167 | |
| 168 | handshakeProtocols.insert(sHandshake.TypeId()); |
| 169 | handshakeProtocols.insert(sHandshake0.TypeId()); |
| 170 | handshakeProtocols.insert(keepAlive.TypeId()); |
| 171 | } |
| 172 | |
| 173 | /* |
| 174 | void print(const char* name, const void* data, int size) |
nothing calls this directly
no test coverage detected