Difference between revisions of "enet.host:connect"

m
Line 6: Line 6:
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|string|address|The address to connect to in the format "ip:port"}}
+
{{param|string|address|The address to connect to in the format "ip:port".}}
 
{{param|number|channel_count|The number of channels to allocate. It should be the same as the channel count on the server. Defaults to 1.}}
 
{{param|number|channel_count|The number of channels to allocate. It should be the same as the channel count on the server. Defaults to 1.}}
 
{{param|number|data|An integer value that can be associated with the connect [[enet.event | event]]. Defaults to 0.}}
 
{{param|number|data|An integer value that can be associated with the connect [[enet.event | event]]. Defaults to 0.}}
 
=== Returns ===
 
=== Returns ===
{{param|userdata|peer|An [[enet.peer | peer]].}}
+
{{param|userdata|peer|A [[enet.peer | peer]].}}
  
 
== See Also ==
 
== See Also ==

Revision as of 19:33, 23 July 2014

Connects a host to a remote host. Returns peer object associated with the remote host. The actual connection will not take place until the next host:service() is called, in which a "connect" event will be generated.

Function

Synopsis

peer = host:connect(address, channel_count, data)

Arguments

string address
The address to connect to in the format "ip:port".
number channel_count
The number of channels to allocate. It should be the same as the channel count on the server. Defaults to 1.
number data
An integer value that can be associated with the connect event. Defaults to 0.

Returns

userdata peer
A peer.

See Also

Other Languages