/// <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; }
/// <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); } }
public void AddPort(ServerPort serverPort) { }