Orxonox: orxonox::ServerConnection Class Reference

# orxonox::ServerConnection Class Reference

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

Inheritance diagram for orxonox::ServerConnection:

List of all members.

## Public Member Functions

bool | closeListener ()
void | disconnectClient (int clientID)
virtual void | disconnectClient (ClientInformation *client)
void | disconnectPeer (ENetEvent *event)
bool | openListener ()
void | setBindAddress (const std::string &bindAddress)
void | setPort (unsigned int port)
| ~ServerConnection ()

## Static Public Member Functions

static bool | addPacket (ENetPacket *packet, unsigned int ID)
static bool | addPacketAll (ENetPacket *packet)

## Protected Member Functions

void | disconnectClients ()
| ServerConnection ()

## Private Member Functions

int | getClientID (ENetAddress *address)
int | getClientID (ENetPeer *peer)
ENetPeer * | getClientPeer (int clientID)

## Private Attributes

ENetAddress * | bindAddress_
bool | bListening_

## Constructor & Destructor Documentation

orxonox::ServerConnection::~ServerConnection | ( |  | ) |

References bindAddress_, bListening_, and closeListener().

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

References bindAddress_, and orxonox::NETWORK_PORT.

## Member Function Documentation

bool orxonox::ServerConnection::addPacket | ( | ENetPacket * | packet,
|  | unsigned int | ID |
| ) |  |  | `[static]`

References orxonox::Connection::addPacket(), addPacketAll(), orxonox::CLIENTID_UNKNOWN, COUT, orxonox::ClientInformation::findClient(), and orxonox::ClientInformation::getPeer().

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

bool orxonox::ServerConnection::addPacketAll | ( | ENetPacket * | packet | ) | `[static]`

References orxonox::Connection::getHost(), and orxonox::Connection::getInstance().

Referenced by addPacket().

bool orxonox::ServerConnection::closeListener | ( |  | ) |

References bListening_, disconnectClients(), and orxonox::Connection::host_.

Referenced by orxonox::Server::close(), and ~ServerConnection().

void orxonox::ServerConnection::disconnectClient | ( | int | clientID | ) |

References disconnectClient(), and orxonox::ClientInformation::findClient().

void orxonox::ServerConnection::disconnectClient | ( | ClientInformation * | client | ) | `[virtual]`

Reimplemented in orxonox::Server.

References orxonox::Connection::disconnectPeer(), and orxonox::ClientInformation::getPeer().

Referenced by disconnectClient(), orxonox::Server::disconnectClient(), disconnectClients(), and disconnectPeer().

void orxonox::ServerConnection::disconnectClients | ( |  | ) | `[protected]`

References disconnectClient(), orxonox::ClientInformation::findClient(), orxonox::ClientInformation::getBegin(), orxonox::ClientInformation::next(), and orxonox::Connection::service().

Referenced by orxonox::Server::close(), and closeListener().

void orxonox::ServerConnection::disconnectPeer | ( | ENetEvent * | event | ) | `[virtual]`

Implements orxonox::Connection.

References COUT, disconnectClient(), and orxonox::ClientInformation::findClient().

int orxonox::ServerConnection::getClientID | ( | ENetAddress * | address | ) | `[private]`

References orxonox::ClientInformation::findClient(), and orxonox::ClientInformation::getID().

int orxonox::ServerConnection::getClientID | ( | ENetPeer * | peer | ) | `[private]`

ENetPeer * orxonox::ServerConnection::getClientPeer | ( | int | clientID | ) | `[private]`

References orxonox::ClientInformation::findClient(), and orxonox::ClientInformation::getPeer().

bool orxonox::ServerConnection::openListener | ( |  | ) |

References bindAddress_, orxonox::Connection::host_, and orxonox::NETWORK_MAX_CONNECTIONS.

Referenced by orxonox::Server::open().

void orxonox::ServerConnection::setBindAddress | ( | const std::string & | bindAddress | ) |

References bindAddress_.

Referenced by orxonox::Server::Server().

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

References bindAddress_.

Referenced by orxonox::Server::Server().

## Member Data Documentation

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

Reimplemented from orxonox::Connection.

Referenced by openListener(), ServerConnection(), setBindAddress(), setPort(), and ~ServerConnection().

bool orxonox::ServerConnection::bListening_`[private]`

Referenced by closeListener(), and ~ServerConnection().

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

- src/network/ServerConnection.h
- src/network/ServerConnection.cc