Sites

Menu

PlatformApiEndpoint Class

Namespace: Improbable.SpatialOS.Platform.Common

Settings specifying a service endpoint in the form of a host name and port. This class is immutable and thread-safe.

Inheritance

IEquatable<PlatformApiEndpoint>


Properties

Host
string Host { get; }

The host name to connect to. Must not be null or empty.
Port
int Port { get; }

The port to connect to, in the range 1 to 65535 inclusive.
Insecure
bool Insecure { get; }

Whether the connection is encrypted or not. For unencrypted connections no authentication data is sent.


Constructors

PlatformApiEndpoint
PlatformApiEndpoint(string host, int port, bool insecure = false)

Initializes a new instance of the PlatformApiEndpoint class. Creates a new endpoint with the given host and port.

Parameters
  • string host : The host name to connect to. Must not be null or empty.
  • int port : The port to connect to, in the range 1 to 65535 inclusive.
  • bool insecure : Whether the connection is encrypted or not. For unencrypted connections no authentication data is sent.


Methods

Equals
bool Equals(PlatformApiEndpoint other)

Determines equality between this endpoint and .

Returns:
if is a PlatformApiEndpoint with the same host and port; otherwise.

Parameters
WithHost
PlatformApiEndpoint WithHost(string host)

Creates a new endpoint with the same port but the given host.

Returns:
A new endpoint with the same port and the specified host.

Parameters
  • string host : The host name to connect to. Must not be null or empty.
WithPort
PlatformApiEndpoint WithPort(int port)

Creates a new endpoint with the same host but the given port.

Returns:
A new endpoint with the same host and the specified port.

Parameters
  • int port : The port to connect to, in the range 1 to 65535 inclusive.


Overrides

ToString
override string ToString()

Returns this endpoint's data in the format "host:port".

Returns:
This endpoint's data in the format "host:port".
Equals
override bool Equals(object obj)

Determines equality between this object and .

Returns:
if is a PlatformApiEndpoint with the same host and port; otherwise.

Parameters
  • object obj : The object to compare with this one.
GetHashCode
override int GetHashCode()

Returns a hash code for this object, consistent with Equals(PlatformApiEndpoint).

Returns:
A hash code for this object.

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums