public class ServerPort : object
A port exposed by a server.
Namespace
Grpc.CoreAssembly
Grpc.Core.dll
Constructors
ServerPort(String, Int32, ServerCredentials)
public ServerPort(string host, int port, ServerCredentials credentials)
Creates a new port on which server should listen.
Type | Name | Description |
---|---|---|
String | host | the host |
Int32 | port | the port. If zero, an unused port is chosen automatically. |
ServerCredentials | credentials | credentials to use to secure this port. |
Fields
PickUnused
public const int PickUnused = null
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.
Type | Description |
---|---|
Int32 |
Properties
BoundPort
public int BoundPort { get; }
Type | Description |
---|---|
Int32 | The port actually bound by the server. This is useful if you let server pick port automatically. PickUnused |
Credentials
public ServerCredentials Credentials { get; }
Type | Description |
---|---|
ServerCredentials | The server credentials. |
Host
public string Host { get; }
Type | Description |
---|---|
String | The host. |
Port
public int Port { get; }
Type | Description |
---|---|
Int32 | The port. |