class MgcGateway

This class represents a transport connection between the agent and the gateway from the agent's perspective

Public Fields

bool debugFlag

Public Methods

MgcGatewayHandle addGateway(const char* address, int portRemote=DEFAULT_MGCP_PORT_FOR_GATEWAY)
void addToFdSet( fd_set* set )
add the appropriate FDs to the fd_set for the stack (for select)
void asyncProcess()
process timeouts and resends if the non-blocking APIs are called
Sptr <MgcCommand> asyncReceive()
non-blocking receive of a message
bool asyncReply(const Sptr<MgcCommand>& command, MgcGatewayHandle handle=0)
non-blocking reply to a message
bool asyncSend(MgcCommand& command, MgcGatewayHandle handle=0)
non-blocking send of a message
bool checkIfSet( fd_set* set )
check if any of the appropriate FDs are set for the stack (post-select)
bool checkMsgReady( fd_set* set )
check if any messages are waiting to be receive()'d.
bool commandPending()
void flushMessages()
int getFd()
Sptr <MgcCommand> getNextMessage()
private function gets data from the network (cleanly?)
bool handleTimeouts(struct timeval* tv)
MgcGateway(int portLocal=DEFAULT_MGCP_PORT_FOR_CALLAGENT)
this constructor does not take any outgoing gateways initially -- all of them must be constructed on the fly
MgcGateway( const char* address, int portRemote=DEFAULT_MGCP_PORT_FOR_GATEWAY, int portLocal=DEFAULT_MGCP_PORT_FOR_CALLAGENT )
constructor
bool processPending()
void processPendingBlock()
Sptr <MgcCommand> receive()
blocking receive of a message
bool reply(const Sptr<MgcCommand>& command, MgcGatewayHandle handle=0)
blocking reply of a message
bool send(MgcCommand& command, MgcGatewayHandle handle=0)
blocking send of a message
void setAsync()
void setSync()
void threadProcess()

Public

blocking reply of a message

Private Fields

vector < Sptr > gatewayList
list of gateways to transmit to
typedef map MgcMsgStuffMap
message information type
VCondition* msgPending
condition variable for a pending message
bool msgWaiting
true if a message is waiting
VMutex* networkMutex
mutex for network
VCondition* networkPending
condition variable for a response pending
deque MgcCommand> > pendingMessages
enqueueing thing
deque pendingPackets
simple message grab
VMutex* queueMutex
mutex for the queue
VCondition* respPending
condition variable for a response pending
bool respWaiting
a response is waiting
MgcMsgStuffMap sentMessages
sent message information
map < UniqueId, Sptr > sentResponses
sent responses
Sptr server
data for receiving from the call agent
Timer timeoutMsgs
time out system for sentMessages
Timer timeoutResp
time out system for sentResponses
map < UniqueId, int > TransWaiting
a map of requests currently waiting for processing
bool useAsync
true if using async
bool useOne

Private Methods

void handlePacket()
...
void processRangeInRespAck( const string& s, const NetworkAddress& srcAddr )
process response acknowledgement attribute and set flags in sentResponses for confirmed responses

Documentation

This class represents a transport connection between the agent and the gateway from the agent's perspective
MgcGateway(int portLocal=DEFAULT_MGCP_PORT_FOR_CALLAGENT)
this constructor does not take any outgoing gateways initially -- all of them must be constructed on the fly
Parameters:
portLocal - the local port to listen for the agent on.

MgcGateway( const char* address, int portRemote=DEFAULT_MGCP_PORT_FOR_GATEWAY, int portLocal=DEFAULT_MGCP_PORT_FOR_CALLAGENT )
constructor.
Parameters:
address - the address/hostname of the gateway
portRemote - The port of the gateway
portLocal - the local port to listen for the gateway on.

MgcGatewayHandle addGateway(const char* address, int portRemote=DEFAULT_MGCP_PORT_FOR_GATEWAY)

bool send(MgcCommand& command, MgcGatewayHandle handle=0)
blocking send of a message

blocking reply of a message

bool reply(const Sptr<MgcCommand>& command, MgcGatewayHandle handle=0)
blocking reply of a message

Sptr <MgcCommand> receive()
blocking receive of a message

void setAsync()

void setSync()

bool asyncSend(MgcCommand& command, MgcGatewayHandle handle=0)
non-blocking send of a message

bool asyncReply(const Sptr<MgcCommand>& command, MgcGatewayHandle handle=0)
non-blocking reply to a message

Sptr <MgcCommand> asyncReceive()
non-blocking receive of a message

void asyncProcess()
process timeouts and resends if the non-blocking APIs are called

void addToFdSet( fd_set* set )
add the appropriate FDs to the fd_set for the stack (for select)

bool checkIfSet( fd_set* set )
check if any of the appropriate FDs are set for the stack (post-select)

bool checkMsgReady( fd_set* set )
check if any messages are waiting to be receive()'d.

bool debugFlag

bool commandPending()

int getFd()

Sptr <MgcCommand> getNextMessage()
private function gets data from the network (cleanly?)

void flushMessages()

void threadProcess()

void processPendingBlock()

bool processPending()

bool handleTimeouts(struct timeval* tv)

void processRangeInRespAck( const string& s, const NetworkAddress& srcAddr )
process response acknowledgement attribute and set flags in sentResponses for confirmed responses

vector < Sptr > gatewayList
list of gateways to transmit to

Sptr server
data for receiving from the call agent

deque MgcCommand> > pendingMessages
enqueueing thing

map < UniqueId, int > TransWaiting
a map of requests currently waiting for processing

deque pendingPackets
simple message grab

bool msgWaiting
true if a message is waiting

bool respWaiting
a response is waiting

VMutex* queueMutex
mutex for the queue

VMutex* networkMutex
mutex for network

VCondition* msgPending
condition variable for a pending message

VCondition* respPending
condition variable for a response pending

VCondition* networkPending
condition variable for a response pending

typedef map MgcMsgStuffMap
message information type

MgcMsgStuffMap sentMessages
sent message information

Timer timeoutMsgs
time out system for sentMessages

map < UniqueId, Sptr > sentResponses
sent responses

Timer timeoutResp
time out system for sentResponses

bool useAsync
true if using async

bool useOne

void handlePacket()
...


This class has no child classes.

alphabetic index hierarchy of classes


generated by doc++