|
| ENet () |
|
bool | initialize () |
|
Host * | createHost (const Common::String &address, int port, int numClients, int numChannels=1, int incBand=0, int outBand=0) |
|
Host * | connectToHost (const Common::String &hostAddress, int hostPort, const Common::String &address, int port, int timeout=5000, int numChannels=1, int incBand=0, int outBand=0) |
|
Host * | connectToHost (const Common::String &address, int port, int timeout=5000, int numChannels=1, int incBand=0, int outBand=0) |
|
Socket * | createSocket (const Common::String &address, int port) |
|
◆ ENet()
Networking::ENet::ENet |
( |
| ) |
|
The main object that allows for ENet host and socket creation.
◆ initialize()
bool Networking::ENet::initialize |
( |
| ) |
|
Initializes the ENet library. Must be called first before any other functions.
- Returns
- true if successful, false on failure.
◆ createHost()
Host* Networking::ENet::createHost |
( |
const Common::String & |
address, |
|
|
int |
port, |
|
|
int |
numClients, |
|
|
int |
numChannels = 1 , |
|
|
int |
incBand = 0 , |
|
|
int |
outBand = 0 |
|
) |
| |
Creates a new ENet Host instance for listening for/connecting to peers.
- Parameters
-
address | the address at which other peers may connect to this host. "0.0.0.0" may be to used to use the default host. |
port | a port number this host will use. |
numClients | the maximum number of peers that should be allocated for the host. |
numChannels | the maximum number of channels allowed; if 0, then this is equivalent to ENET_PROTOCOL_MAXIMUM_CHANNEL_COUNT |
incBand | downstream bandwidth of the host in bytes/second; if 0, ENet will assume unlimited bandwidth. |
outBand | upstream bandwidth of the host in bytes/second; if 0, ENet will assume unlimited bandwidth. |
- Return values
-
- See also
- Networking::Host
◆ connectToHost()
Host* Networking::ENet::connectToHost |
( |
const Common::String & |
hostAddress, |
|
|
int |
hostPort, |
|
|
const Common::String & |
address, |
|
|
int |
port, |
|
|
int |
timeout = 5000 , |
|
|
int |
numChannels = 1 , |
|
|
int |
incBand = 0 , |
|
|
int |
outBand = 0 |
|
) |
| |
Creates a new ENet Host instance, and attempts to connect to the assigned address and port.
- Parameters
-
hostAddress | the address this host will use to connect to this peer. "0.0.0.0" may be to used to use the default host. |
hostPort | a port number this host will use. If not used, the host will use an allocated port given by the operating system. |
address | the address of the peer that will attempt to connect to. |
port | the port number of the peer that will attempt to connect to. |
timeout | specifies the connection timeout in milliseconds, 5 full seconds by default. Will fail if the given time has passed. |
numChannels | the maximum number of channels allowed; if 0, then this is equivalent to ENET_PROTOCOL_MAXIMUM_CHANNEL_COUNT. This must match with the connecting peer. |
incBand | downstream bandwidth of the host in bytes/second; if 0, ENet will assume unlimited bandwidth. This must match with the connecting peer. |
outBand | upstream bandwidth of the host in bytes/second; if 0, ENet will assume unlimited bandwidth. This must match with the connecting peer. |
- Return values
-
- See also
- Networking::Host
◆ createSocket()
Creates a Networking::Socket instance which is a representation of a raw UDP socket. Useful for and sending and receiving data that is outside the ENet library protocol.
- Parameters
-
address | the address this socket will send to and/or receive data from. |
port | the port number this socket will send to and/or receive data from. |
- Return values
-
- See also
- Networking::Socket
The documentation for this class was generated from the following file:
- backends/networking/enet/enet.h