#include <connection.hpp>
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. |
The remote host can use a ConnectionHandler to handle this incoming connection.
Definition at line 36 of file connection.hpp.
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().