|
MASA-Core
|
#include <Peer.hpp>
Public Member Functions | |
| Peer (int socket, const string &localId, bool initiator, int connectionType=CONNECTION_TYPE_UNKNOWN) | |
| Peer (string remoteId, string remoteAddress, const int remoteType, const int ringType, const int connectionType) | |
| virtual | ~Peer () |
| Command * | recvCommand () |
| Command * | sendCommand (Command *command) |
| void | addHook (int id, int serial=-1) |
| Command * | waitHook () |
| bool | isConnected () |
| bool | handshake () |
| bool | waitHandshake () |
| void | finalize () |
| void | send_int32 (int value) |
| int | recv_int32 () |
| void | send_int16 (short value) |
| short | recv_int16 () |
| void | send_int8 (char value) |
| char | recv_int8 () |
| void | send_array (const char *value, int len) |
| void | recv_array (char *value, int len) |
| void | send_vls8 (const char *value) |
| void | recv_vls8 (char *value, int max=-1) |
| void | send_vls8 (const string &value) |
| string | recv_vls8 () |
| void | recv_dummy (int len) |
| void | setLocalType (int localType) |
| void | setLocalAddress (const string &publicAddress) |
| const string & | getLocalAddress () const |
| const string & | getRemoteAddress () const |
| const string & | getLocalId () const |
| const string & | getRemoteId () const |
| int | getLocalType () const |
| int | getRemoteType () const |
| string | toString () |
| void | setCallback (MasaNetCallbacks *callback) |
| bool | isInitiator () const |
| int | getSocket () const |
| int | getConnectionType () const |
Static Public Member Functions | |
| static void | registerCommandCreator (int id, cmd_creator_f creator) |
Public Attributes | |
| int | ringType |
Private Member Functions | |
| bool | handshakeInitiator () |
| bool | handshakeInitiated () |
| int | getNextSerial () |
| void | notifyHook (Command *cmd) |
| void | handleSendError (int ret) |
| void | handleRecvError (int ret) |
Static Private Member Functions | |
| static float | getGlobalTime () |
| static float | getElapsedTime (timeval *end_time, timeval *start_time) |
Private Attributes | |
| MasaNetCallbacks * | callback |
| pthread_mutex_t | mutex |
| pthread_cond_t | responseCond |
| pthread_cond_t | handshakeCond |
| int | socket |
| bool | initiator |
| bool | handshakeDone |
| bool | connected |
| bool | error |
| int | serial |
| float | timeout |
| int | connectionType |
| map< int, set< pthread_t > > | hookThreads |
| map< pthread_t, Command * > | hookCommand |
| map< pthread_t, int > | hookSerial |
| string | localId |
| string | remoteId |
| string | localAddress |
| string | remoteAddress |
| int | remoteType |
| int | localType |
Static Private Attributes | |
| static map< int, cmd_creator_f > | cmdCreators |
| static bool | hasStaticEvent = false |
| static timeval | staticEvent |
| Peer::Peer | ( | int | socket, |
| const string & | localId, | ||
| bool | initiator, | ||
| int | connectionType = CONNECTION_TYPE_UNKNOWN |
||
| ) |
| Peer::Peer | ( | string | remoteId, |
| string | remoteAddress, | ||
| const int | remoteType, | ||
| const int | ringType, | ||
| const int | connectionType | ||
| ) |
| Peer::~Peer | ( | ) | [virtual] |
| void Peer::addHook | ( | int | id, |
| int | serial = -1 |
||
| ) |
| void Peer::finalize | ( | ) |
| int Peer::getConnectionType | ( | ) | const |
| float Peer::getElapsedTime | ( | timeval * | end_time, |
| timeval * | start_time | ||
| ) | [static, private] |
| float Peer::getGlobalTime | ( | ) | [static, private] |
| const string & Peer::getLocalAddress | ( | ) | const |
| const string & Peer::getLocalId | ( | ) | const |
| int Peer::getLocalType | ( | ) | const |
| int Peer::getNextSerial | ( | ) | [private] |
| const string & Peer::getRemoteAddress | ( | ) | const |
| const string & Peer::getRemoteId | ( | ) | const |
| int Peer::getRemoteType | ( | ) | const |
| int Peer::getSocket | ( | ) | const |
| void Peer::handleRecvError | ( | int | ret | ) | [private] |
| void Peer::handleSendError | ( | int | ret | ) | [private] |
| bool Peer::handshake | ( | ) |
| bool Peer::handshakeInitiated | ( | ) | [private] |
| bool Peer::handshakeInitiator | ( | ) | [private] |
| bool Peer::isConnected | ( | ) |
| bool Peer::isInitiator | ( | ) | const |
| void Peer::notifyHook | ( | Command * | cmd | ) | [private] |
| void Peer::recv_array | ( | char * | value, |
| int | len | ||
| ) |
| void Peer::recv_dummy | ( | int | len | ) |
| short Peer::recv_int16 | ( | ) |
| int Peer::recv_int32 | ( | ) |
| char Peer::recv_int8 | ( | ) |
| void Peer::recv_vls8 | ( | char * | value, |
| int | max = -1 |
||
| ) |
| string Peer::recv_vls8 | ( | ) |
| Command * Peer::recvCommand | ( | ) |
| void Peer::registerCommandCreator | ( | int | id, |
| cmd_creator_f | creator | ||
| ) | [static] |
| void Peer::send_array | ( | const char * | value, |
| int | len | ||
| ) |
| void Peer::send_int16 | ( | short | value | ) |
| void Peer::send_int32 | ( | int | value | ) |
| void Peer::send_int8 | ( | char | value | ) |
| void Peer::send_vls8 | ( | const char * | value | ) |
| void Peer::send_vls8 | ( | const string & | value | ) |
| Command * Peer::sendCommand | ( | Command * | command | ) |
| void Peer::setCallback | ( | MasaNetCallbacks * | callback | ) |
| void Peer::setLocalAddress | ( | const string & | publicAddress | ) |
| void Peer::setLocalType | ( | int | localType | ) |
| string Peer::toString | ( | ) |
| bool Peer::waitHandshake | ( | ) |
| Command * Peer::waitHook | ( | ) |
MasaNetCallbacks* Peer::callback [private] |
map< int, cmd_creator_f > Peer::cmdCreators [static, private] |
bool Peer::connected [private] |
int Peer::connectionType [private] |
bool Peer::error [private] |
pthread_cond_t Peer::handshakeCond [private] |
bool Peer::handshakeDone [private] |
bool Peer::hasStaticEvent = false [static, private] |
map<pthread_t, Command*> Peer::hookCommand [private] |
map<pthread_t, int> Peer::hookSerial [private] |
map<int, set<pthread_t> > Peer::hookThreads [private] |
bool Peer::initiator [private] |
string Peer::localAddress [private] |
string Peer::localId [private] |
int Peer::localType [private] |
pthread_mutex_t Peer::mutex [private] |
string Peer::remoteAddress [private] |
string Peer::remoteId [private] |
int Peer::remoteType [private] |
pthread_cond_t Peer::responseCond [private] |
| int Peer::ringType |
int Peer::serial [private] |
int Peer::socket [private] |
timeval Peer::staticEvent [static, private] |
float Peer::timeout [private] |
1.7.6.1