Exemple #1
0
 /// <summary>
 /// Create a new server.
 /// </summary>
 /// <param name="options">Channel options.</param>
 public Server(IEnumerable <ChannelOption> options = null)
 {
     using (var channelArgs = ChannelOptions.CreateChannelArgs(options))
     {
         this.handle = ServerSafeHandle.NewServer(GetCompletionQueue(), channelArgs);
     }
 }
Exemple #2
0
 /// <summary>
 /// Create a new server.
 /// </summary>
 /// <param name="options">Channel options.</param>
 public Server(IEnumerable <ChannelOption> options = null)
 {
     this.environment = GrpcEnvironment.GetInstance();
     using (var channelArgs = ChannelOptions.CreateChannelArgs(options))
     {
         this.handle = ServerSafeHandle.NewServer(environment.CompletionQueue, channelArgs);
     }
 }
Exemple #3
0
 /// <summary>
 /// Create a new server.
 /// </summary>
 /// <param name="options">Channel options.</param>
 public Server(IEnumerable <ChannelOption> options = null)
 {
     this.serviceDefinitions = new ServiceDefinitionCollection(this);
     this.ports       = new ServerPortCollection(this);
     this.environment = GrpcEnvironment.AddRef();
     this.options     = options != null ? new List <ChannelOption>(options) : new List <ChannelOption>();
     using (var channelArgs = ChannelOptions.CreateChannelArgs(this.options))
     {
         this.handle = ServerSafeHandle.NewServer(environment.CompletionQueue, channelArgs);
     }
 }
Exemple #4
0
 public Server()
 {
     this.handle = ServerSafeHandle.NewServer(GetCompletionQueue(), IntPtr.Zero);
     this.newServerRpcHandler   = HandleNewServerRpc;
     this.serverShutdownHandler = HandleServerShutdown;
 }