/// <summary>
 /// Creates a port from an existing <c>ServerPort</c> instance and boundPort value.
 /// </summary>
 internal ServerPort(ServerPort serverPort, int boundPort)
 {
     this.host = serverPort.host;
     this.port = serverPort.port;
     this.credentials = serverPort.credentials;
     this.boundPort = boundPort;
 }
Exemple #2
0
 /// <summary>
 /// Creates a port from an existing <c>ServerPort</c> instance and boundPort value.
 /// </summary>
 internal ServerPort(ServerPort serverPort, int boundPort)
 {
     this.host        = serverPort.host;
     this.port        = serverPort.port;
     this.credentials = serverPort.credentials;
     this.boundPort   = boundPort;
 }
Exemple #3
0
 /// <summary>
 /// Adds a listening port.
 /// </summary>
 private int AddPortInternal(ServerPort serverPort)
 {
     lock (myLock)
     {
         GrpcPreconditions.CheckNotNull(serverPort.Credentials, "serverPort");
         GrpcPreconditions.CheckState(!startRequested);
         var address = string.Format("{0}:{1}", serverPort.Host, serverPort.Port);
         int boundPort;
         using (var nativeCredentials = serverPort.Credentials.ToNativeCredentials())
         {
             if (nativeCredentials != null)
             {
                 boundPort = handle.AddSecurePort(address, nativeCredentials);
             }
             else
             {
                 boundPort = handle.AddInsecurePort(address);
             }
         }
         var newServerPort = new ServerPort(serverPort, boundPort);
         this.serverPortList.Add(newServerPort);
         return(boundPort);
     }
 }
Exemple #4
0
 public void AddPort(ServerPort serverPort)
 {
 }