ENet Class Library for C#

Host.InitializeServer Method

Initialize a host that will accept connections on any IP address.

[Visual Basic]
Public Sub InitializeServer( _
   ByVal port As Integer, _
   ByVal peerLimit As Integer _
)
[C#]
public void InitializeServer(
   int port,
   int peerLimit
);

Parameters

port
The port to listen on.
peerLimit
The maximum number of peers for this host.

Exceptions

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

See Also

Host Class | ENet Namespace