ENet Class Library for C#

Host.Service Method

Sends queued outgoing packets, receives incoming packets, and handles connection events.

[Visual Basic]
Public Sub Service( _
   ByVal timeout As Integer, _
   ByRef event As Event _
)
[C#]
public bool Service(
   int timeout,
   out Event event
);

Parameters

timeout
Timeout in milliseconds to wait for an event. For polling, use 0.
event
The event.

Return Value

True if an event occured, otherwise false.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException timeout is negative.
InvalidOperationException The host is not initialized.
ENetException An error occured.

See Also

Host Class | ENet Namespace