Connection Class Reference

A point-to-point connection to a remote host. More...

#include <connection.hpp>

Inheritance diagram for Connection:

AccountConnection

List of all members.

Public Member Functions

bool start (const std::string &, int)
 Connects to the given host/port and waits until the connection is established.
void stop ()
 Disconnects.
bool isConnected () const
 Returns whether the connection is established or not.
void send (const MessageOut &msg, bool reliable=true, unsigned channel=0)
 Sends a message to the remote host.
void process ()
 Dispatches received messages to processMessage.

Protected Member Functions

virtual void processMessage (MessageIn &)=0
 Processes a single message from the remote host.


Detailed Description

A point-to-point connection to a remote host.

The remote host can use a ConnectionHandler to handle this incoming connection.

Definition at line 36 of file connection.hpp.


Member Function Documentation

bool Connection::start ( const std::string &  address,
int  port 
)

Connects to the given host/port and waits until the connection is established.

Returns false if it fails to connect.

Definition at line 34 of file connection.cpp.

References stop().

Referenced by AccountConnection::start().


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

Generated on Sun Apr 26 17:30:46 2009 for TMW Server Collection by  doxygen 1.5.5