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 _
public void InitializeServer(
   int port,
   int peerLimit


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


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