gRPC C#
gRPC C#
Namespaces
Grpc.Core
Server.ServerPortCollection Class
ServerPortCollection Methods
Add Method
Add Method (ServerPort)
Add Method (String, Int32, ServerCredentials)

Server ServerPortCollection Add Method (String, Int32, ServerCredentials)

Adds a new port on which server should listen.

#### Return Value

Type: Int32
The port on which server will be listening.

Namespace: Grpc.Core
Assembly: Grpc.Core (in Grpc.Core.dll) Version: 0.7.0.0
Syntax
C#
VB
C++
F#
Copy

    public int Add(
    	string host,
    	int port,
    	ServerCredentials credentials
    )

    Public Function Add (
    	host As String,
    	port As Integer,
    	credentials As ServerCredentials
    ) As Integer

    public:
    int Add(
    	String^ host,
    	int port,
    	ServerCredentials^ credentials
    )

    member Add :
            host : string *
            port : int *
            credentials : ServerCredentials -> int

#### Parameters

host
  Type: System
  String
  the host
port
  Type: System
  Int32
  the port. If zero, an unused port is chosen automatically.
credentials
  Type: Grpc.Core
  ServerCredentials
  credentials to use to secure this port.

#### Return Value

Type: Int32
See Also

#### Reference

Server
ServerPortCollection Class
Add Overload
Grpc.Core Namespace