Exemplo n.º 1
0
 /// <exception cref="System.IO.IOException"/>
 private Server CreateServer <_T0>(Type pbProtocol, IPEndPoint addr, Configuration
                                   conf, SecretManager <_T0> secretManager, int numHandlers, BlockingService blockingService
                                   , string portRangeConfig)
     where _T0 : TokenIdentifier
 {
     RPC.SetProtocolEngine(conf, pbProtocol, typeof(ProtobufRpcEngine));
     RPC.Server server = new RPC.Builder(conf).SetProtocol(pbProtocol).SetInstance(blockingService
                                                                                   ).SetBindAddress(addr.GetHostName()).SetPort(addr.Port).SetNumHandlers(numHandlers
                                                                                                                                                          ).SetVerbose(false).SetSecretManager(secretManager).SetPortRangeConfig(portRangeConfig
                                                                                                                                                                                                                                 ).Build();
     Log.Info("Adding protocol " + pbProtocol.GetCanonicalName() + " to the server");
     server.AddProtocol(RPC.RpcKind.RpcProtocolBuffer, pbProtocol, blockingService);
     return(server);
 }