ENet Class Library for C#

Host.Initialize Method

Initialize a host that will accept connections on a particular address, or not accept connections.

[Visual Basic]
Public Sub Initialize( _
   ByVal address As IPEndPoint, _
   ByVal peerLimit As Integer, _
   Optional ByVal channelLimit As Integer = 0, _
   Optional ByVal incomingBandwidth As Integer = 0, _
   Optional ByVal outgoingBandwidth As Integer = 0 _
public void Initialize(
   IPEndPoint address,
   int peerLimit,
   int channelLimit,
   int incomingBandwidth,
   int outgoingBandwidth


The address to listen on, or null to not accept connections.
The maximum number of peers for this host.
The maximum number of channels, or 0 to use the maximum possible (255).
The maximum incoming rate of transfer, or 0 for no limit.
The maximum outgoing rate of transfer, or 0 for no limit.


Exception Type Condition
ArgumentOutOfRangeException peerLimit is less than 0 or greater than 4095, channelLimit is less than 0 or greater than 255, incomingBandwidth is less than 0, and/or outgoingBandwidth is less than 0.
InvalidOperationException The host is already initialized.
ENetException Failed to initialize the host.

See Also

Host Class | ENet Namespace