MCPcopy Create free account
hub / github.com/FoundationDB/fdb-document-layer / extServer

Function extServer

src/DocLayer.actor.cpp:269–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269ACTOR void extServer(Reference<DocumentLayer> docLayer, NetworkAddress addr) {
270 state ActorCollection connections(false);
271 state int64_t nextConnectionId = 1;
272 try {
273 state Reference<IListener> listener = INetworkConnections::net()->listen(addr);
274
275 TraceEvent("BD_server").detail("version", FDB_DOC_VT_PACKAGE_NAME).detail("address", addr.toString());
276 fprintf(stdout, "FdbDocServer (%s): listening on %s\n", FDB_DOC_VT_PACKAGE_NAME, addr.toString().c_str());
277
278 loop choose {
279 when(Reference<IConnection> conn = wait(listener->accept())) {
280 Reference<BufferedConnection> bc(new BufferedConnection(conn));
281 connections.add(extServerConnection(docLayer, bc, nextConnectionId));
282 nextConnectionId++;
283 }
284 when(wait(connections.getResult())) { ASSERT(false); }
285 }
286 } catch (Error& e) {
287 TraceEvent(SevError, "BD_server").error(e);
288 fprintf(stderr, "FdbDocServer: fatal error: %s\n", e.what());
289 g_network->stop();
290 throw;
291 }
292}
293
294ACTOR Future<Void> extProxyHandler(Reference<BufferedConnection> src,
295 Reference<BufferedConnection> dest,

Callers 1

setupFunction · 0.85

Calls 3

stopMethod · 0.80
whenFunction · 0.70
toStringMethod · 0.45

Tested by

no test coverage detected