irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

xmsgLib.cpp File Reference
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
#include "rsApiHandler.hpp"
#include "miscServerFunct.hpp"
#include "xmsgLib.hpp"
#include "irods_network_factory.hpp"
#include "initServer.hpp"
#include "sockCommNetworkInterface.hpp"
Include dependency graph for xmsgLib.cpp:

Go to the source code of this file.

Functions

int initThreadEnv ()
 
int addXmsgToQues (irodsXmsg_t *irodsXmsg, ticketMsgStruct_t *ticketMsgStruct)
 
int addXmsgToXmsgQue (irodsXmsg_t *xmsg, xmsgQue_t *xmsgQue)
 
int rmXmsgFromXmsgQue (irodsXmsg_t *xmsg, xmsgQue_t *xmsgQue)
 
int rmXmsgFromXmsgTcketQue (irodsXmsg_t *xmsg, xmsgQue_t *xmsgQue)
 
int addXmsgToTicketMsgStruct (irodsXmsg_t *xmsg, ticketMsgStruct_t *ticketMsgStruct)
 
int checkMsgCondition (irodsXmsg_t *irodsXmsg, char *msgCond)
 
int getIrodsXmsg (rcvXmsgInp_t *rcvXmsgInp, irodsXmsg_t **outIrodsXmsg)
 
int getIrodsXmsgByMsgNum (int rcvTicket, int msgNumber, irodsXmsg_t **outIrodsXmsg)
 
int addTicketToHQue (xmsgTicketInfo_t *ticket, ticketHashQue_t *ticketHQue)
 
int addTicketMsgStructToHQue (ticketMsgStruct_t *ticketMsgStruct, ticketHashQue_t *ticketHQue)
 
int rmTicketMsgStructFromHQue (ticketMsgStruct_t *ticketMsgStruct, ticketHashQue_t *ticketHQue)
 
int addReqToQue (int sock)
 
xmsgReq_tgetReqFromQue ()
 
int startXmsgThreads ()
 
void procReqRoutine ()
 
int ticketHashFunc (uint rcvTicket)
 
int initXmsgHashQue ()
 
int getTicketMsgStructByTicket (uint rcvTicket, ticketMsgStruct_t **outTicketMsgStruct)
 
int _rsRcvXmsg (irodsXmsg_t *irodsXmsg, rcvXmsgOut_t *rcvXmsgOut)
 
int clearOneXMessage (ticketMsgStruct_t *ticketMsgStruct, int seqNum)
 
int clearAllXMessages (ticketMsgStruct_t *ticketMsgStruct)
 

Variables

static boost::mutex ReqQueCondMutex
 
static boost::mutex MessQueCondMutex
 
static boost::thread * ProcReqThread [40]
 
static boost::condition_variable ReqQueCond
 
static xmsgQue_t XmsgQue
 
static xmsgReq_tXmsgReqHead = 0
 
static xmsgReq_tXmsgReqTail = 0
 
static msParamArray_t XMsgMsParamArray
 
ticketHashQue_t XmsgHashQue [47]
 

Function Documentation

◆ _rsRcvXmsg()

◆ addReqToQue()

int addReqToQue ( int  sock)

Definition at line 405 of file xmsgLib.cpp.

References XmsgReq::next, NULL, ReqQueCond, ReqQueCondMutex, XmsgReq::sock, XmsgReqHead, and XmsgReqTail.

Referenced by xmsgServerMain().

◆ addTicketMsgStructToHQue()

int addTicketMsgStructToHQue ( ticketMsgStruct_t ticketMsgStruct,
ticketHashQue_t ticketHQue 
)

Definition at line 314 of file xmsgLib.cpp.

References TicketHashQue::head, TicketMsgStruct::hnext, TicketMsgStruct::hprev, LOG_ERROR, NULL, TicketMsgStruct::nxtSeqNumber, XmsgTicketInfo::rcvTicket, rodsLog(), SYS_DUPLICATE_XMSG_TICKET, SYS_INTERNAL_NULL_INPUT_ERR, TicketHashQue::tail, TicketMsgStruct::ticket, and TicketMsgStruct::ticketHashQue.

Referenced by addTicketToHQue().

Here is the call graph for this function:

◆ addTicketToHQue()

int addTicketToHQue ( xmsgTicketInfo_t ticket,
ticketHashQue_t ticketHQue 
)

Definition at line 288 of file xmsgLib.cpp.

References addTicketMsgStructToHQue(), LOG_ERROR, NULL, rodsLog(), irods.pypyodbc::status, SYS_INTERNAL_NULL_INPUT_ERR, and TicketMsgStruct::ticket.

Referenced by initXmsgHashQue(), and rsGetXmsgTicket().

Here is the call graph for this function:

◆ addXmsgToQues()

int addXmsgToQues ( irodsXmsg_t irodsXmsg,
ticketMsgStruct_t ticketMsgStruct 
)

Definition at line 48 of file xmsgLib.cpp.

References addXmsgToTicketMsgStruct(), addXmsgToXmsgQue(), MessQueCondMutex, and irods.pypyodbc::status.

Referenced by rsSendXmsg().

Here is the call graph for this function:

◆ addXmsgToTicketMsgStruct()

int addXmsgToTicketMsgStruct ( irodsXmsg_t xmsg,
ticketMsgStruct_t ticketMsgStruct 
)

Definition at line 145 of file xmsgLib.cpp.

References XmsgTicketInfo::expireTime, XmsgQue::head, INC_EXPIRE_INT, LOG_ERROR, NULL, TicketMsgStruct::nxtSeqNumber, rodsLog(), IrodsXmsg::sendTime, IrodsXmsg::seqNumber, SYS_INTERNAL_NULL_INPUT_ERR, XmsgQue::tail, TicketMsgStruct::ticket, IrodsXmsg::ticketMsgStruct, IrodsXmsg::tnext, IrodsXmsg::tprev, and TicketMsgStruct::xmsgQue.

Referenced by addXmsgToQues().

Here is the call graph for this function:

◆ addXmsgToXmsgQue()

int addXmsgToXmsgQue ( irodsXmsg_t xmsg,
xmsgQue_t xmsgQue 
)

Definition at line 63 of file xmsgLib.cpp.

References XmsgQue::head, LOG_ERROR, IrodsXmsg::next, NULL, IrodsXmsg::prev, rodsLog(), SYS_INTERNAL_NULL_INPUT_ERR, and XmsgQue::tail.

Referenced by addXmsgToQues().

Here is the call graph for this function:

◆ checkMsgCondition()

◆ clearAllXMessages()

int clearAllXMessages ( ticketMsgStruct_t ticketMsgStruct)

Definition at line 740 of file xmsgLib.cpp.

References clearSendXmsgInfo(), XmsgQue::head, NULL, rmXmsgFromXmsgQue(), IrodsXmsg::sendXmsgInfo, XmsgQue::tail, IrodsXmsg::tnext, and TicketMsgStruct::xmsgQue.

Referenced by rsSendXmsg().

Here is the call graph for this function:

◆ clearOneXMessage()

int clearOneXMessage ( ticketMsgStruct_t ticketMsgStruct,
int  seqNum 
)

Definition at line 717 of file xmsgLib.cpp.

References clearSendXmsgInfo(), XmsgQue::head, NULL, rmXmsgFromXmsgQue(), rmXmsgFromXmsgTcketQue(), IrodsXmsg::sendXmsgInfo, IrodsXmsg::seqNumber, IrodsXmsg::tnext, and TicketMsgStruct::xmsgQue.

Referenced by rsSendXmsg().

Here is the call graph for this function:

◆ getIrodsXmsg()

int getIrodsXmsg ( rcvXmsgInp_t rcvXmsgInp,
irodsXmsg_t **  outIrodsXmsg 
)

Definition at line 209 of file xmsgLib.cpp.

References checkMsgCondition(), getTicketMsgStructByTicket(), XmsgQue::head, LOG_ERROR, MessQueCondMutex, RcvXmsgInp::msgCondition, NULL, RcvXmsgInp::rcvTicket, rodsLog(), irods.pypyodbc::status, SYS_INTERNAL_NULL_INPUT_ERR, SYS_NO_XMSG_FOR_MSG_NUMBER, IrodsXmsg::tnext, and TicketMsgStruct::xmsgQue.

Referenced by rsRcvXmsg().

Here is the call graph for this function:

◆ getIrodsXmsgByMsgNum()

int getIrodsXmsgByMsgNum ( int  rcvTicket,
int  msgNumber,
irodsXmsg_t **  outIrodsXmsg 
)

Definition at line 246 of file xmsgLib.cpp.

References ANY_MSG_NUMBER, getTicketMsgStructByTicket(), XmsgQue::head, LOG_ERROR, SendXmsgInfo::msgNumber, NULL, rodsLog(), IrodsXmsg::sendXmsgInfo, irods.pypyodbc::status, SYS_INTERNAL_NULL_INPUT_ERR, SYS_NO_XMSG_FOR_MSG_NUMBER, IrodsXmsg::tnext, and TicketMsgStruct::xmsgQue.

Here is the call graph for this function:

◆ getReqFromQue()

xmsgReq_t* getReqFromQue ( )

Definition at line 431 of file xmsgLib.cpp.

References XmsgReq::next, NULL, ReqQueCond, ReqQueCondMutex, and XmsgReqHead.

Referenced by procReqRoutine().

◆ getTicketMsgStructByTicket()

int getTicketMsgStructByTicket ( uint  rcvTicket,
ticketMsgStruct_t **  outTicketMsgStruct 
)

Definition at line 635 of file xmsgLib.cpp.

References TicketHashQue::head, TicketMsgStruct::hnext, NULL, XmsgTicketInfo::rcvTicket, SYS_UNMATCHED_XMSG_TICKET, TicketMsgStruct::ticket, ticketHashFunc(), and XmsgHashQue.

Referenced by getIrodsXmsg(), getIrodsXmsgByMsgNum(), and rsSendXmsg().

Here is the call graph for this function:

◆ initThreadEnv()

int initThreadEnv ( )

Definition at line 42 of file xmsgLib.cpp.

Referenced by xmsgServerMain().

◆ initXmsgHashQue()

int initXmsgHashQue ( )

Definition at line 564 of file xmsgLib.cpp.

References addIntParamToArray(), addMsParam(), addTicketToHQue(), XmsgTicketInfo::expireTime, XmsgTicketInfo::flag, MAX_EXPIRE_INT, NULL, NUM_HASH_SLOT, XmsgTicketInfo::rcvTicket, XmsgTicketInfo::sendTicket, STR_MS_T, ticketHashFunc(), XmsgHashQue, and XMsgMsParamArray.

Referenced by xmsgServerMain().

Here is the call graph for this function:

◆ procReqRoutine()

void procReqRoutine ( )

Definition at line 482 of file xmsgLib.cpp.

References irods::error::code(), getReqFromQue(), initRsCommWithStartupPack(), irods::log(), LOG_ERROR, LOG_NOTICE, irods::network_factory(), NULL, irods::error::ok(), PASS, readAndProcClientMsg(), readStartupPack(), REQ_MSG_TIMEOUT_TIME, rodsLog(), sendVersion(), rsComm_t::sock, XmsgReq::sock, and SYS_AGENT_INIT_ERR.

Referenced by startXmsgThreads().

Here is the call graph for this function:

◆ rmTicketMsgStructFromHQue()

int rmTicketMsgStructFromHQue ( ticketMsgStruct_t ticketMsgStruct,
ticketHashQue_t ticketHQue 
)

Definition at line 373 of file xmsgLib.cpp.

References TicketHashQue::head, TicketMsgStruct::hnext, TicketMsgStruct::hprev, LOG_ERROR, NULL, rodsLog(), SYS_INTERNAL_NULL_INPUT_ERR, and TicketHashQue::tail.

Referenced by rsSendXmsg().

Here is the call graph for this function:

◆ rmXmsgFromXmsgQue()

int rmXmsgFromXmsgQue ( irodsXmsg_t xmsg,
xmsgQue_t xmsgQue 
)

Definition at line 87 of file xmsgLib.cpp.

References XmsgQue::head, LOG_ERROR, IrodsXmsg::next, NULL, IrodsXmsg::prev, rodsLog(), SYS_INTERNAL_NULL_INPUT_ERR, and XmsgQue::tail.

Referenced by _rsRcvXmsg(), clearAllXMessages(), and clearOneXMessage().

Here is the call graph for this function:

◆ rmXmsgFromXmsgTcketQue()

int rmXmsgFromXmsgTcketQue ( irodsXmsg_t xmsg,
xmsgQue_t xmsgQue 
)

Definition at line 116 of file xmsgLib.cpp.

References XmsgQue::head, LOG_ERROR, NULL, rodsLog(), SYS_INTERNAL_NULL_INPUT_ERR, XmsgQue::tail, IrodsXmsg::tnext, and IrodsXmsg::tprev.

Referenced by _rsRcvXmsg(), and clearOneXMessage().

Here is the call graph for this function:

◆ startXmsgThreads()

int startXmsgThreads ( )

Definition at line 468 of file xmsgLib.cpp.

References NUM_XMSG_THR, procReqRoutine(), ProcReqThread, and SYS_THREAD_RESOURCE_ERR.

Referenced by xmsgServerMain().

Here is the call graph for this function:

◆ ticketHashFunc()

int ticketHashFunc ( uint  rcvTicket)

Definition at line 558 of file xmsgLib.cpp.

References NUM_HASH_SLOT.

Referenced by getTicketMsgStructByTicket(), initXmsgHashQue(), and rsGetXmsgTicket().

Variable Documentation

◆ MessQueCondMutex

boost::mutex MessQueCondMutex
static

Definition at line 26 of file xmsgLib.cpp.

Referenced by _rsRcvXmsg(), addXmsgToQues(), and getIrodsXmsg().

◆ ProcReqThread

boost::thread* ProcReqThread[ 40]
static

Definition at line 27 of file xmsgLib.cpp.

Referenced by startXmsgThreads().

◆ ReqQueCond

boost::condition_variable ReqQueCond
static

Definition at line 28 of file xmsgLib.cpp.

Referenced by addReqToQue(), and getReqFromQue().

◆ ReqQueCondMutex

boost::mutex ReqQueCondMutex
static

Definition at line 25 of file xmsgLib.cpp.

Referenced by addReqToQue(), and getReqFromQue().

◆ XmsgHashQue

ticketHashQue_t XmsgHashQue[47]

Definition at line 37 of file xmsgLib.cpp.

Referenced by getTicketMsgStructByTicket(), initXmsgHashQue(), and rsGetXmsgTicket().

◆ XMsgMsParamArray

msParamArray_t XMsgMsParamArray
static

Definition at line 33 of file xmsgLib.cpp.

Referenced by checkMsgCondition(), and initXmsgHashQue().

◆ XmsgQue

Definition at line 30 of file xmsgLib.cpp.

◆ XmsgReqHead

xmsgReq_t* XmsgReqHead = 0
static

Definition at line 31 of file xmsgLib.cpp.

Referenced by addReqToQue(), and getReqFromQue().

◆ XmsgReqTail

xmsgReq_t* XmsgReqTail = 0
static

Definition at line 32 of file xmsgLib.cpp.

Referenced by addReqToQue().