Class ServerPort
A port exposed by a server.
Inheritance
System.Object
    ServerPort
  Inherited Members
      System.Object.Equals(System.Object)
    
    
      System.Object.Equals(System.Object, System.Object)
    
    
      System.Object.GetHashCode()
    
    
      System.Object.GetType()
    
    
      System.Object.MemberwiseClone()
    
    
      System.Object.ReferenceEquals(System.Object, System.Object)
    
    
      System.Object.ToString()
    
  Namespace: Grpc.Core
Assembly: Grpc.Core.dll
Syntax
public class ServerPortConstructors
ServerPort(String, Int32, ServerCredentials)
Creates a new port on which server should listen.
Declaration
public ServerPort(string host, int port, ServerCredentials credentials)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | host | the host | 
| System.Int32 | port | the port. If zero, an unused port is chosen automatically. | 
| ServerCredentials | credentials | credentials to use to secure this port. | 
Fields
PickUnused
Pass this value as port to have the server choose an unused listening port for you. Ports added to a server will contain the bound port in their BoundPort property.
Declaration
public const int PickUnused = 0Field Value
| Type | Description | 
|---|---|
| System.Int32 | 
Properties
BoundPort
Declaration
public int BoundPort { get; }Property Value
| Type | Description | 
|---|---|
| System.Int32 | The port actually bound by the server. This is useful if you let server pick port automatically. PickUnused | 
Credentials
Declaration
public ServerCredentials Credentials { get; }Property Value
| Type | Description | 
|---|---|
| ServerCredentials | The server credentials. | 
Host
Declaration
public string Host { get; }Property Value
| Type | Description | 
|---|---|
| System.String | The host. | 
Port
Declaration
public int Port { get; }Property Value
| Type | Description | 
|---|---|
| System.Int32 | The port. |