Connections used by the NetworkManager to allow the NetworkServer to accept incoming connections on more than one port. More...
Inherits NetworkConnection.
Public Member Functions | |
new void | Disconnect () |
Disconnect this connection. More... | |
override void | Initialize (string networkAddress, int netHostId, int netConnId, HostTopology hostTopology) |
Adds an offset to the connectionId and then calls base.Initialize() More... | |
override bool | TransportSend (byte[] bytes, int numBytes, int channelId, out byte error) |
Send some bytes over the network. More... | |
Properties | |
int | offset [get] |
Connections used by the NetworkManager to allow the NetworkServer to accept incoming connections on more than one port.
These connections are used by ExternalServer. They get added to NetworkServer via AddExternalConnection. When the connection is initialized we have to add an offset to the networkConnectionId to prevent it overlapping with other connections added to NetworkServer. When the NetworkServer attempts to send data out over the connection we intercept it and un-offset the connectionId to get back to the actual hostId / connectionId combo that we want to use to send.
new void Disconnect | ( | ) |
Disconnect this connection.
Just like the normal Disconnect method except this one uses the proper un-offset connection id.
override void Initialize | ( | string | networkAddress, |
int | netHostId, | ||
int | netConnId, | ||
HostTopology | hostTopology | ||
) |
Adds an offset to the connectionId and then calls base.Initialize()
networkAddress | The network address. |
netHostId | The net host identifier. |
netConnId | The net connection identifier. |
hostTopology | The host topology. |
override bool TransportSend | ( | byte [] | bytes, |
int | numBytes, | ||
int | channelId, | ||
out byte | error | ||
) |
Send some bytes over the network.
Un-offsets the connectionId to get the id of the connection on the ExternalServer.
bytes | The bytes. |
numBytes | The number bytes. |
channelId | The channel identifier. |
error | The error. |