Difference between revisions of "enet.host create"

m
m (Synopsis: This isn't a global...)
Line 7: Line 7:
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
host = host_create(bind_address, peer_count, channel_count, in_bandwidth, out_bandwidth)
+
host = enet.host_create(bind_address, peer_count, channel_count, in_bandwidth, out_bandwidth)
 
</source>
 
</source>
 +
 
=== Arguments ===
 
=== Arguments ===
 
{{param|string|bind_address|The address to connect to in the format "ip:port".}}
 
{{param|string|bind_address|The address to connect to in the format "ip:port".}}

Revision as of 02:39, 30 October 2016

Returns a new host. All arguments are optional.

A bind_address of nil makes a host that can not be connected to (typically a client). Otherwise the address can either be of the form <ipaddress>:<port>, <hostname>:<port>, or *:<port>.

Example addresses include "127.0.0.1:8888", "localhost:2232", and "*:6767".

Function

Synopsis

host = enet.host_create(bind_address, peer_count, channel_count, in_bandwidth, out_bandwidth)

Arguments

string bind_address
The address to connect to in the format "ip:port".
number peer_count
The max number of peers. Defaults to 64.
number in_bandwidth
Downstream bandwidth in bytes/sec. Defaults to 0 (unlimited).
number channel_count
The max number of channels. Defaults to 1.
number out_bandwidth
Upstream bandwidth in bytes/sec. Defaults to 0 (unlimited).

Returns

enet.host host
The requested host.

See Also

Other Languages