Orxonox: orxonox::ClientConnection Class Reference

# orxonox::ClientConnection Class Reference

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

Inheritance diagram for orxonox::ClientConnection:

List of all members.

## Public Member Functions

bool | addPacket (ENetPacket *packet)
| ClientConnection ()
virtual bool | closeConnection ()
virtual bool | establishConnection ()
ENetEvent * | getEvent ()
bool | isConnected ()
bool | queueEmpty ()
void | setPort (unsigned int port)
void | setServerAddress (const std::string &serverAddress)
virtual | ~ClientConnection ()

## Private Member Functions

virtual void | addClient (ENetEvent *event)
bool | disconnectConnection ()
virtual void | disconnectPeer (ENetEvent *event)

## Private Attributes

bool | established_
ENetPeer * | server_
ENetAddress * | serverAddress_

## Constructor & Destructor Documentation

orxonox::ClientConnection::ClientConnection | ( |  | ) |

References orxonox::NETWORK_PORT, and serverAddress_.

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

References closeConnection(), established_, and serverAddress_.

## Member Function Documentation

void orxonox::ClientConnection::addClient | ( | ENetEvent * | event | ) | `[private, virtual]`

Implements orxonox::Connection.

bool orxonox::ClientConnection::addPacket | ( | ENetPacket * | packet | ) |

References orxonox::Connection::addPacket(), and server_.

Referenced by orxonox::Client::queuePacket().

bool orxonox::ClientConnection::closeConnection | ( |  | ) | `[virtual]`

Reimplemented in orxonox::Client.

References COUT, established_, orxonox::Connection::host_, orxonox::NETWORK_CLIENT_CONNECTION_TIMEOUT, orxonox::NETWORK_CLIENT_WAIT_TIME, and server_.

Referenced by orxonox::Client::closeConnection(), and ~ClientConnection().

bool orxonox::ClientConnection::disconnectConnection | ( |  | ) | `[private]`

void orxonox::ClientConnection::disconnectPeer | ( | ENetEvent * | event | ) | `[private, virtual]`

Implements orxonox::Connection.

References COUT, and established_.

bool orxonox::ClientConnection::establishConnection | ( |  | ) | `[virtual]`

Reimplemented in orxonox::Client.

References COUT, established_, orxonox::Connection::host_, orxonox::NETWORK_CLIENT_CHANNELS, orxonox::NETWORK_CLIENT_CONNECTION_TIMEOUT, orxonox::NETWORK_CLIENT_MAX_CONNECTIONS, orxonox::NETWORK_CLIENT_WAIT_TIME, server_, and serverAddress_.

Referenced by orxonox::Client::establishConnection().

ENetEvent* orxonox::ClientConnection::getEvent | ( |  | ) |

bool orxonox::ClientConnection::isConnected | ( |  | ) | `[inline]`

Referenced by orxonox::Client::update(), and orxonox::Client::~Client().

bool orxonox::ClientConnection::queueEmpty | ( |  | ) |

void orxonox::ClientConnection::setPort | ( | unsigned int | port | ) |

References serverAddress_.

Referenced by orxonox::Client::Client().

void orxonox::ClientConnection::setServerAddress | ( | const std::string & | serverAddress | ) |

References serverAddress_.

Referenced by orxonox::Client::Client().

## Member Data Documentation

bool orxonox::ClientConnection::established_`[private]`

Referenced by closeConnection(), disconnectPeer(), establishConnection(), and ~ClientConnection().

ENetPeer* orxonox::ClientConnection::server_`[private]`

Referenced by addPacket(), closeConnection(), and establishConnection().

ENetAddress* orxonox::ClientConnection::serverAddress_`[private]`

Referenced by ClientConnection(), establishConnection(), setPort(), setServerAddress(), and ~ClientConnection().

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

- src/network/ClientConnection.h
- src/network/ClientConnection.cc