Show / Hide Table of Contents

Class Server.ServerPortCollection

Collection of server ports.

Inheritance
System.Object
Server.ServerPortCollection
Implements
System.Collections.Generic.IEnumerable<ServerPort>
System.Collections.IEnumerable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Grpc.Core
Assembly: Grpc.Core.dll
Syntax
public class ServerPortCollection : IEnumerable<ServerPort>, IEnumerable

Methods

Add(ServerPort)

Adds a new port on which server should listen. Only call this before Start(). The port on which server will be listening.

Declaration
public int Add(ServerPort serverPort)
Parameters
Type Name Description
ServerPort serverPort
Returns
Type Description
System.Int32

Add(String, Int32, ServerCredentials)

Adds a new port on which server should listen. The port on which server will be listening.

Declaration
public int Add(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.

Returns
Type Description
System.Int32

GetEnumerator()

Gets enumerator for this collection.

Declaration
public IEnumerator<ServerPort> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<ServerPort>
Implements
System.Collections.Generic.IEnumerable<T>.GetEnumerator()

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator
Implements
System.Collections.IEnumerable.GetEnumerator()
Back to top