More...
|
|
| ConnectionService (IEntityWorldService entityWorlds) |
| |
| void | ConnectToServer (NetworkEndpoint endpoint) |
| | Configure NetworkStreamRequestConnect to connect to a given server endpoint.
|
| |
| void | ConnectToServer (string ip, ushort port) |
| | Configure NetworkStreamRequestConnect to connect to a given server IP/port.
|
| |
| void | ListenForClientConnections (ushort port) |
| | Configure NetworkStreamRequestListen to listen for client connections on a given port.
|
| |
| void | ListenForClientConnections (NetworkEndpoint endpoint) |
| | Configure NetworkStreamRequestListen to listen for client connections for a given endpoint.
|
| |
| bool | TryGetLocalNetworkEndpoint (ushort port, out NetworkEndpoint endpoint) |
| |
| bool | TryParseNetworkEndpoint (string address, ushort port, out NetworkEndpoint endpoint) |
| | Parse IP and port to a NetworkEndpoint, defaulting to IPv4 and falling back to IPv6.- Returns
- True if the address could be parsed.
|
| |
| void | UseDefaultNetworkDriver () |
| | Configure NetworkStreamReceiveSystem to use the default NetworkStreamDriver. This will work for most connection scenarios.
|
| |
| void | UseCustomNetworkDriver (INetworkStreamDriverConstructor customDriverConstructor) |
| | Configure NetworkStreamReceiveSystem to use a custom NetworkStreamDriver. This is needed to configure the NetworkStreamDriver for relay sessions.
|
| |
| bool | TryGetFirstAvailableLocalUdpPort (PortRange range, out ushort availablePort) |
| | From a range of ports, get the first local UDP port that is available.- Parameters
-
| range | The port range to check. |
| availablePort | The first available port. |
- Returns
- True if any port in the range was available.
|
| |
◆ ConnectToServer() [1/2]
| void ConnectToServer |
( |
NetworkEndpoint | endpoint | ) |
|
|
inline |
Configure NetworkStreamRequestConnect to connect to a given server endpoint.
Implements IConnectionService.
◆ ConnectToServer() [2/2]
| void ConnectToServer |
( |
string | ip, |
|
|
ushort | port ) |
|
inline |
Configure NetworkStreamRequestConnect to connect to a given server IP/port.
Implements IConnectionService.
◆ ListenForClientConnections() [1/2]
| void ListenForClientConnections |
( |
NetworkEndpoint | endpoint | ) |
|
|
inline |
Configure NetworkStreamRequestListen to listen for client connections for a given endpoint.
Implements IConnectionService.
◆ ListenForClientConnections() [2/2]
| void ListenForClientConnections |
( |
ushort | port | ) |
|
|
inline |
Configure NetworkStreamRequestListen to listen for client connections on a given port.
Implements IConnectionService.
◆ TryGetFirstAvailableLocalUdpPort()
| bool TryGetFirstAvailableLocalUdpPort |
( |
PortRange | range, |
|
|
out ushort | availablePort ) |
|
inline |
From a range of ports, get the first local UDP port that is available.
- Parameters
-
| range | The port range to check. |
| availablePort | The first available port. |
- Returns
- True if any port in the range was available.
Implements IConnectionService.
◆ TryGetLocalNetworkEndpoint()
| bool TryGetLocalNetworkEndpoint |
( |
ushort | port, |
|
|
out NetworkEndpoint | endpoint ) |
|
inline |
Gets the local network endpoint which others should connect to for LAN sessions.
- Parameters
-
| port | The port clients should connect to. |
| endpoint | The network endpoint, if found. |
- Returns
- True if a local network endpoint could be found.
To establish the true outgoing IP, we attempt to connect a socket to CloudFlare DNS (1.1.1.1), and observe the local endpoint IP. If this is not possible (CloudFlare unavailable, or we have no internet connection), we return the IPv4 loopback address.
Implements IConnectionService.
◆ TryParseNetworkEndpoint()
| bool TryParseNetworkEndpoint |
( |
string | address, |
|
|
ushort | port, |
|
|
out NetworkEndpoint | endpoint ) |
|
inline |
Parse IP and port to a NetworkEndpoint, defaulting to IPv4 and falling back to IPv6.
- Returns
- True if the address could be parsed.
Implements IConnectionService.
◆ UseCustomNetworkDriver()
| void UseCustomNetworkDriver |
( |
INetworkStreamDriverConstructor | customDriverConstructor | ) |
|
|
inline |
Configure NetworkStreamReceiveSystem to use a custom NetworkStreamDriver. This is needed to configure the NetworkStreamDriver for relay sessions.
Implements IConnectionService.
◆ UseDefaultNetworkDriver()
| void UseDefaultNetworkDriver |
( |
| ) |
|
|
inline |
Configure NetworkStreamReceiveSystem to use the default NetworkStreamDriver. This will work for most connection scenarios.
Implements IConnectionService.
The documentation for this class was generated from the following file:
- Runtime/Connection/ConnectionService.cs