#include <PostOffice.h>
Public Slots | |
string | connectTo (const string &host, int port, bool block=true) |
bool | servicePort (int port) |
void | closePort (int port) |
void | addAddressToGroup (const POAddress &adr, const POAddress &group) |
void | removeAddressFromGroup (const POAddress &adr, const POAddress &group) |
POBox * | registerPOBox (const string &name) |
POGroup * | registerGroup (const string &name, bool throw_exception=true) |
bool | closeGroup (const string &name) |
bool | closePOBox (const string &name, bool dodelete=false) |
void | connectClient (POClient *client) |
void | addConnectedClient (POClient *client) |
bool | sendMessage (const POMessage *msg, bool throw_exception=true) |
void | sendMessage (POMessage *msg, const string &from, const POAddress &to) |
void | newClientPOBox (const string &cname, const string &boxname) |
Signals | |
void | newClient (const string &poname, const string &cname) |
void | newPOBox (const string &poname, const string &cname, const string &boxname) |
void | newPOBox (const string &poname, const string &boxname) |
void | clientClosed (const string &poname, const string &cname) |
void | portClosed (int port) |
void | portOpened (int port) |
Public Member Functions | |
PostOffice (const string &name) | |
~PostOffice () | |
POClient * | getClient (const string &cname) const |
POBox * | getPOBox (const string &boxname) const |
POGroup * | getGroup (const string &name, bool create=true, bool throw_exception=true) |
map< string, POClient * > | getAllClients () const |
map< string, POBox * > | getAllBoxes () const |
string | getName () const |
const POMessage * | popMessage (const string &pobox_name) |
bool | hasMessage (const string &pobox_name) |
Static Public Member Functions | |
map< string, PostOffice * > | getAllPostOffices () |
PostOffice * | getPostOffice (const string &name) |
|
Constructor
|
|
|
|
Adds the specified address to the group. This is useful for aggregating groups. Be careful, the group may not be able to send to the specified address.
|
|
Takes a connected client and adds it to the client list, m_clients
|
|
|
|
Removes a group
|
|
Removes the box from the post officeThis should only be called by ~POBox() when you delete it.
|
|
Closes the server on a given port
|
|
This function is called when a POServer gets a new connection. The connection is connected by sending it a list of POBoxes in this post office.
|
|
Creates a new client and attempts to connect to the specified server
|
|
|
|
|
|
This function returns a pointer to all post offices running within the current process
|
|
|
|
Returns a pointer to the group based on name Throws an error if the group doesn't exist and create == false
|
|
|
|
returns a pointer to the specified pobox
|
|
|
|
Checks a POBox for messages
|
|
|
|
|
|
|
|
|
|
This function allows you to pop a message from the specified POBox
|
|
|
|
|
|
Creates a new group with the specified name
|
|
Creates a new post office box and updates all connections
|
|
Adds the specified address to the group. This is useful for aggregating groups. Be careful, the group may not be able to send to the specified address.
|
|
Sends a message to the specified address from the specified pobox in this PostOffice to the specified addres and returns true if the destination exists Throws a POErrorMsg* if the destination can't be found
|
|
Identifies where the message needs to go and sends it. Assumes that the to/from fields have been filled out by the POBox
|
|
Creates a new POServer that listens for connections on the specified port
|