Beispiel #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);
     }
 }
Beispiel #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);
     }
 }
Beispiel #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);
     }
 }
Beispiel #4
0
 internal static extern ErrorCode CionServerUnsetDataReceivedCb(ServerSafeHandle server, CionServerDataReceivedCb cb);
Beispiel #5
0
 internal static extern ErrorCode CionServerAddDisconnectedCb(ServerSafeHandle server, CionServerDisconnectedCb cb, IntPtr userData);
Beispiel #6
0
 internal static extern ErrorCode CionServerRemovePayloadReceivedCb(ServerSafeHandle server, CionServerPayloadReceivedCb cb, IntPtr userData);
Beispiel #7
0
 internal static extern ErrorCode CionServerSetDataReceivedCb(ServerSafeHandle server, CionServerDataReceivedCb cb, IntPtr userData);
Beispiel #8
0
 internal static extern ErrorCode CionServerCreate(out ServerSafeHandle server, string serviceName, string displayName, IntPtr security);
Beispiel #9
0
 internal static extern ErrorCode CionServerRemoveConnectionResultCb(ServerSafeHandle server, CionServerConnectionResultCb cb);
Beispiel #10
0
 internal static extern ErrorCode CionServerSendPayloadAsync(ServerSafeHandle server, PeerInfoSafeHandle peerInfo, PayloadSafeHandle payload, CionServerPayloadAsyncResultCb cb, IntPtr userData);
Beispiel #11
0
 public Server()
 {
     this.handle = ServerSafeHandle.NewServer(GetCompletionQueue(), IntPtr.Zero);
     this.newServerRpcHandler   = HandleNewServerRpc;
     this.serverShutdownHandler = HandleServerShutdown;
 }
Beispiel #12
0
 internal static extern ErrorCode CionServerReject(ServerSafeHandle server, PeerInfoSafeHandle peerInfo, string reason);
Beispiel #13
0
 internal static extern ErrorCode CionServerDisconnect(ServerSafeHandle server, PeerInfoSafeHandle peerInfo);
Beispiel #14
0
 internal static extern ErrorCode CionServerAccept(ServerSafeHandle server, PeerInfoSafeHandle peerInfo);
Beispiel #15
0
 internal static extern ErrorCode CionServerStop(ServerSafeHandle server);
Beispiel #16
0
 internal static extern ErrorCode CionServerListen(ServerSafeHandle server, CionServerConnectionRequestCb cb, IntPtr userData);
Beispiel #17
0
 internal static extern ErrorCode CionServerRemoveDisconnectedCb(ServerSafeHandle server, CionServerDisconnectedCb cb);
 internal static extern ErrorCode CionServerAddErrorReportedCb(ServerSafeHandle server, CionServerErrorReportedCb cb, IntPtr userData);
Beispiel #19
0
 internal static extern ErrorCode CionServerSetOnDemandLaunchEnabled(ServerSafeHandle server, bool enable);
Beispiel #20
0
 internal static extern ErrorCode CionServerAddConnectionResultCb(ServerSafeHandle server, CionServerConnectionResultCb cb, IntPtr userData);
Beispiel #21
0
 internal static extern ErrorCode CionServerForeachConnectedPeerInfo(ServerSafeHandle server, CionServerPeerInfoIterator cb, IntPtr userData);
Beispiel #22
0
 internal static extern ErrorCode CionServerSetDisplayName(ServerSafeHandle server, string displayName);