Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
orxonox::ServerConnection Class Reference

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/network/ServerConnection.h>

Inheritance diagram for orxonox::ServerConnection:
orxonox::Connection orxonox::Server

Public Member Functions

 ~ServerConnection ()
 Destructor. More...
 
void addPacket (ENetPacket *packet, unsigned int ID, uint8_t channelID)
 Add outgoing packet to queue. More...
 
bool closeListener ()
 Stop listening. More...
 
void disconnectClient (int clientID)
 Terminate connection with a peer. More...
 
bool openListener ()
 
void setBindAddress (const std::string &bindAddress)
 Set address on which to listen. More...
 
void setPort (unsigned int port)
 Set port on which to listen on. More...
 
- Public Member Functions inherited from orxonox::Connection
virtual ~Connection ()
 Destructor. More...
 

Protected Member Functions

 ServerConnection ()
 Constructor. More...
 
void disconnectClients ()
 Disconnect all peers. More...
 
- Protected Member Functions inherited from orxonox::Connection
 Connection (uint32_t firstPeerID=NETWORK_PEER_ID_SERVER+1)
 Constructor. More...
 
void addPacket (ENetPacket *packet, uint32_t peerID, uint8_t channelID)
 Send a packet. More...
 
virtual void addPeer (uint32_t peerID)=0
 
void broadcastPacket (ENetPacket *packet, uint8_t channelID)
 Send a broadcast packet. More...
 
void disconnectPeer (uint32_t peerID)
 Send an outgoing event of type 'disconnectPeer'. More...
 
void disconnectPeers ()
 Send an outgoing event of type 'disconnectPeers'. More...
 
void disconnectPeersInternal ()
 
void enableCompression ()
 
incomingEvent preprocessConnectEvent (ENetEvent &event)
 
incomingEvent preprocessDisconnectEvent (ENetEvent &event)
 
incomingEvent preprocessReceiveEvent (ENetEvent &event)
 
void processIncomingEvent (ENetEvent &event)
 Handle an incoming event. More...
 
void processOutgoingEvent (outgoingEvent &event)
 Send an event. More...
 
virtual void processPacket (packet::Packet *packet)=0
 
void processQueue ()
 
virtual void removePeer (uint32_t peerID)=0
 
void startCommunicationThread ()
 Start the main communication thread. More...
 
void stopCommunicationThread ()
 Stop the main communication thread. More...
 
void waitOutgoingQueue ()
 

Private Attributes

ENetAddressbindAddress_
 
bool bListening_
 

Additional Inherited Members

- Protected Attributes inherited from orxonox::Connection
ENetHosthost_
 

Constructor & Destructor Documentation

orxonox::ServerConnection::~ServerConnection ( )

Destructor.

orxonox::ServerConnection::ServerConnection ( )
protected

Constructor.

Member Function Documentation

void orxonox::ServerConnection::addPacket ( ENetPacket packet,
unsigned int  clientID,
uint8_t  channelID 
)

Add outgoing packet to queue.

Parameters
packetThe packet to send
clientIDThe ID of the recipient
channelIDThe channel ID
bool orxonox::ServerConnection::closeListener ( )

Stop listening.

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

Terminate connection with a peer.

Parameters
clientIDThe peer with which to terminate the connection.
void orxonox::ServerConnection::disconnectClients ( )
protected

Disconnect all peers.

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

Set address on which to listen.

Parameters
bindAddressThe address on which to listen
void orxonox::ServerConnection::setPort ( unsigned int  port)

Set port on which to listen on.

Parameters
portThe port on which to listen on.

Member Data Documentation

ENetAddress* orxonox::ServerConnection::bindAddress_
private
bool orxonox::ServerConnection::bListening_
private

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