Difference between revisions of "enet.host:service"

Line 1: Line 1:
Wait for events, send and receive any ready packets. If an event is in the queue it will be returned and dequeued. Generally you will want to dequeue all waiting events every frame.
+
Wait for [[enet.event | events]], send and receive any ready packets. If an event is in the queue it will be returned and dequeued. Generally you will want to dequeue all waiting events every frame.
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
Line 6: Line 6:
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|number|timeout|The max number of milliseconds to be waited for an event. Default is 0.}}
+
{{param|number|timeout|The max number of milliseconds to be waited for an [[enet.event | event]]. Default is 0.}}
 
=== Returns ===
 
=== Returns ===
 
{{param|table|event|An [[enet.event | event]] or nil if no events occured.}}
 
{{param|table|event|An [[enet.event | event]] or nil if no events occured.}}
Line 13: Line 13:
 
* [[parent::lua-enet]]
 
* [[parent::lua-enet]]
 
* [[enet.event]]
 
* [[enet.event]]
[[Category:Functions]]
 
{{#set:Description=Append data to an existing file.}}
 
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|enet.host:service}}
 
{{i18n|enet.host:service}}

Revision as of 19:22, 23 July 2014

Wait for events, send and receive any ready packets. If an event is in the queue it will be returned and dequeued. Generally you will want to dequeue all waiting events every frame.

Function

Synopsis

event = host:service( timeout )

Arguments

number timeout
The max number of milliseconds to be waited for an event. Default is 0.

Returns

table event
An event or nil if no events occured.

See Also

Other Languages