use of com.ociweb.pronghorn.network.ServerCoordinator in project GreenLightning by oci-pronghorn.
the class MsgRuntime method buildGraphForServer.
private void buildGraphForServer(MsgApp app) {
HTTPServerConfig config = builder.getHTTPServerConfig();
ServerPipesConfig serverConfig = config.buildServerConfig(builder.parallelTracks());
ServerCoordinator serverCoord = new ServerCoordinator(config.getCertificates(), config.bindHost(), config.bindPort(), serverConfig.maxConnectionBitsOnServer, serverConfig.maxConcurrentInputs, serverConfig.maxConcurrentOutputs, builder.parallelTracks(), false, "Server", config.defaultHostPath());
final int routerCount = builder.parallelTracks();
final Pipe<NetPayloadSchema>[] encryptedIncomingGroup = Pipe.buildPipes(serverConfig.maxConcurrentInputs, serverConfig.incomingDataConfig);
Pipe[] acks = NetGraphBuilder.buildSocketReaderStage(gm, serverCoord, routerCount, serverConfig, encryptedIncomingGroup);
Pipe[] handshakeIncomingGroup = null;
Pipe[] planIncomingGroup;
if (config.isTLS()) {
planIncomingGroup = Pipe.buildPipes(serverConfig.maxConcurrentInputs, serverConfig.incomingDataConfig);
handshakeIncomingGroup = NetGraphBuilder.populateGraphWithUnWrapStages(gm, serverCoord, serverConfig.serverRequestUnwrapUnits, serverConfig.handshakeDataConfig, encryptedIncomingGroup, planIncomingGroup, acks);
} else {
planIncomingGroup = encryptedIncomingGroup;
}
// Must call here so the beginning stages of the graph are drawn first when exporting graph.
app.declareBehavior(this);
buildLastHalfOfGraphForServer(app, serverConfig, serverCoord, routerCount, acks, handshakeIncomingGroup, planIncomingGroup);
}
Aggregations