Orxonox: orxonox::Connection Class Reference

# orxonox::Connection Class Reference

`#include <src/network/Connection.h>`

Inheritance diagram for orxonox::Connection:

List of all members.

## 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

## Constructor & Destructor Documentation

orxonox::Connection::~Connection | ( |  | ) | `[virtual]`

References instance_.

orxonox::Connection::Connection | ( |  | ) | `[protected]`

References instance_.

## Member Function Documentation

virtual void orxonox::Connection::addClient | ( | ENetEvent * | event | ) | `[protected, pure virtual]`

Implemented in orxonox::ClientConnection, and orxonox::Server.

Referenced by processQueue().

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]`

References instance_.

Referenced by orxonox::ServerConnection::addPacketAll().

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().

## Member Data Documentation

ENetAddress* orxonox::Connection::bindAddress_`[private]`

Reimplemented in orxonox::ServerConnection.

ENetHost* orxonox::Connection::host_`[protected]`

Referenced by orxonox::ClientConnection::closeConnection(), orxonox::ServerConnection::closeListener(), orxonox::ClientConnection::establishConnection(), orxonox::ServerConnection::openListener(), processQueue(), sendPackets(), and service().

Connection * orxonox::Connection::instance_ = 0`[static, private]`

Referenced by Connection(), getInstance(), sendPackets(), and ~Connection().

The documentation for this class was generated from the following files:

- src/network/Connection.h
- src/network/Connection.cc