#include <src/network/Connection.h>
Public Member Functions | |
ENetHost * | getHost () |
bool | sendPackets () |
virtual | ~Connection () |
Static Public Member Functions | |
static bool | addPacket (ENetPacket *packet, ENetPeer *peer) |
Protected Member Functions | |
virtual void | addClient (ENetEvent *event)=0 |
Connection () | |
virtual void | disconnectPeer (ENetEvent *event)=0 |
void | disconnectPeer (ENetPeer *peer) |
virtual bool | processPacket (ENetEvent *event) |
void | processQueue () |
int | service (ENetEvent *event) |
Static Protected Member Functions | |
static Connection * | getInstance () |
Protected Attributes | |
ENetHost * | host_ |
Private Attributes | |
ENetAddress * | bindAddress_ |
Static Private Attributes | |
static Connection * | instance_ = 0 |
orxonox::Connection::~Connection | ( | ) | [virtual] |
References instance_.
orxonox::Connection::Connection | ( | ) | [protected] |
References instance_.
virtual void orxonox::Connection::addClient | ( | ENetEvent * | event | ) | [protected, pure virtual] |
bool orxonox::Connection::addPacket | ( | ENetPacket * | packet, | |
ENetPeer * | peer | |||
) | [static] |
References orxonox::NETWORK_DEFAULT_CHANNEL.
Referenced by orxonox::ServerConnection::addPacket(), and orxonox::ClientConnection::addPacket().
virtual void orxonox::Connection::disconnectPeer | ( | ENetEvent * | event | ) | [protected, pure virtual] |
Implemented in orxonox::ClientConnection, and orxonox::ServerConnection.
void orxonox::Connection::disconnectPeer | ( | ENetPeer * | peer | ) | [protected] |
Referenced by orxonox::ServerConnection::disconnectClient(), and processQueue().
ENetHost* orxonox::Connection::getHost | ( | ) | [inline] |
Referenced by orxonox::ServerConnection::addPacketAll().
static Connection* orxonox::Connection::getInstance | ( | ) | [inline, static, protected] |
bool orxonox::Connection::processPacket | ( | ENetEvent * | event | ) | [protected, virtual] |
References orxonox::packet::Packet::createPacket(), and orxonox::packet::Packet::process().
Referenced by processQueue().
void orxonox::Connection::processQueue | ( | ) | [protected] |
References addClient(), disconnectPeer(), host_, orxonox::NETWORK_WAIT_TIMEOUT, and processPacket().
Referenced by orxonox::Server::update(), and orxonox::Client::update().
bool orxonox::Connection::sendPackets | ( | ) |
References host_, and instance_.
Referenced by orxonox::Server::update(), and orxonox::Client::update().
int orxonox::Connection::service | ( | ENetEvent * | event | ) | [protected] |
References host_, and orxonox::NETWORK_WAIT_TIMEOUT.
Referenced by orxonox::ServerConnection::disconnectClients().
ENetAddress* orxonox::Connection::bindAddress_ [private] |
Reimplemented in orxonox::ServerConnection.
ENetHost* orxonox::Connection::host_ [protected] |
Connection * orxonox::Connection::instance_ = 0 [static, private] |
Referenced by Connection(), getInstance(), sendPackets(), and ~Connection().