Class ServerPort

public class ServerPort : object

A port exposed by a server.

Inheritance

Object > ServerPort

Namespace

Grpc.Core

Assembly

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.

Parameters
TypeNameDescription
Stringhost

the host

Int32port

the port. If zero, an unused port is chosen automatically.

ServerCredentialscredentials

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.

Field Value
TypeDescription
Int32

Properties

BoundPort

public int BoundPort { get; }
Property Value
TypeDescription
Int32

The port actually bound by the server. This is useful if you let server pick port automatically. PickUnused

Credentials

public ServerCredentials Credentials { get; }
Property Value
TypeDescription
ServerCredentials

The server credentials.

Host

public string Host { get; }
Property Value
TypeDescription
String

The host.

Port

public int Port { get; }
Property Value
TypeDescription
Int32

The port.