MCPcopy Create free account
hub / github.com/e2wugui/zeze / Service

Method Service

cxx/Net.cpp:149–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 5

TypeIdMethod · 0.65
findMethod · 0.65
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected