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)  

sockComm.h File Reference
#include "rodsDef.h"
#include "rcConnect.h"
#include "rodsPackInstruct.h"
Include dependency graph for sockComm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAX_LISTEN_QUE   50
 
#define DEF_NUMBER_SVR_PORT   200 /* default number of of server ports */
 
#define CONNECT_TIMEOUT_TIME   100 /* connection timeout time in sec */
 
#define RECONNECT_WAIT_TIME   100 /* re-connection timeout time in sec */
 
#define RECONNECT_SLEEP_TIME   300 /* re-connection sleep time in sec */
 
#define MAX_RECONN_RETRY_CNT   4 /* max connect retry count */
 
#define MAX_CONN_RETRY_CNT   3 /* max connect retry count */
 
#define CONNECT_SLEEP_TIME   200000 /* connect sleep time in uSec */
 
#define READ_STARTUP_PACK_TOUT_SEC   100 /* 1 sec timeout */
 
#define READ_VERSION_TOUT_SEC   100 /* 10 sec timeout */
 
#define RECONNECT_ENV
 
#define READING_FROM_CLI   0
 
#define PROCESSING_API   1
 
#define CLOSE_SOCK   close
 

Functions

int sockOpenForInConn (rsComm_t *rsComm, int *portNum, char **addr, int proto)
 
int rodsSetSockOpt (int sock, int tcp_buffer_size)
 
int connectToRhost (rcComm_t *conn, int connectCnt, int reconnFlag)
 
int connectToRhostWithRaddr (struct sockaddr_in *remoteAddr, int windowSize, int timeoutFlag)
 
int connectToRhostWithTout (struct sockaddr *sin)
 
int rodsSleep (int sec, int microSec)
 
int setConnAddr (rcComm_t *conn)
 
int setRemoteAddr (int sock, struct sockaddr_in *remoteAddr)
 
int setLocalAddr (int sock, struct sockaddr_in *localAddr)
 
int sendStartupPack (rcComm_t *conn, int connectCnt, int reconnFlag)
 
int connectToRhostPortal (char *rodsHost, int rodsPort, int cookie, int windowSize)
 
int rsAcceptConn (rsComm_t *svrComm)
 
int irodsCloseSock (int sock)
 
int addUdpPortToPortList (portList_t *thisPortList, int udpport)
 
int getUdpPortFromPortList (portList_t *thisPortList)
 
int getTcpPortFromPortList (portList_t *thisPortList)
 
int addUdpSockToPortList (portList_t *thisPortList, int udpsock)
 
int getUdpSockFromPortList (portList_t *thisPortList)
 
int getTcpSockFromPortList (portList_t *thisPortList)
 
int isReadMsgError (int status)
 
int svrSwitchConnect (rsComm_t *rsComm)
 
int cliSwitchConnect (rcComm_t *conn)
 
int redirectConnToRescSvr (rcComm_t **conn, dataObjInp_t *dataObjInp, rodsEnv *myEnv, int reconnFlag)
 
int rcReconnect (rcComm_t **conn, char *newHost, rodsEnv *myEnv, int reconnFlag)
 
int mySockClose (int sock)
 

Macro Definition Documentation

◆ CLOSE_SOCK

#define CLOSE_SOCK   close

Definition at line 37 of file sockComm.h.

◆ CONNECT_SLEEP_TIME

#define CONNECT_SLEEP_TIME   200000 /* connect sleep time in uSec */

Definition at line 23 of file sockComm.h.

◆ CONNECT_TIMEOUT_TIME

#define CONNECT_TIMEOUT_TIME   100 /* connection timeout time in sec */

Definition at line 18 of file sockComm.h.

◆ DEF_NUMBER_SVR_PORT

#define DEF_NUMBER_SVR_PORT   200 /* default number of of server ports */

Definition at line 17 of file sockComm.h.

◆ MAX_CONN_RETRY_CNT

#define MAX_CONN_RETRY_CNT   3 /* max connect retry count */

Definition at line 22 of file sockComm.h.

◆ MAX_LISTEN_QUE

#define MAX_LISTEN_QUE   50

Definition at line 16 of file sockComm.h.

◆ MAX_RECONN_RETRY_CNT

#define MAX_RECONN_RETRY_CNT   4 /* max connect retry count */

Definition at line 21 of file sockComm.h.

◆ PROCESSING_API

#define PROCESSING_API   1

Definition at line 32 of file sockComm.h.

◆ READ_STARTUP_PACK_TOUT_SEC

#define READ_STARTUP_PACK_TOUT_SEC   100 /* 1 sec timeout */

Definition at line 25 of file sockComm.h.

◆ READ_VERSION_TOUT_SEC

#define READ_VERSION_TOUT_SEC   100 /* 10 sec timeout */

Definition at line 26 of file sockComm.h.

◆ READING_FROM_CLI

#define READING_FROM_CLI   0

Definition at line 31 of file sockComm.h.

◆ RECONNECT_ENV

#define RECONNECT_ENV
Value:
"irodsReconnect" /* reconnFlag will be set to
* RECONN_TIMEOUT if this
* env is set */

Definition at line 28 of file sockComm.h.

◆ RECONNECT_SLEEP_TIME

#define RECONNECT_SLEEP_TIME   300 /* re-connection sleep time in sec */

Definition at line 20 of file sockComm.h.

◆ RECONNECT_WAIT_TIME

#define RECONNECT_WAIT_TIME   100 /* re-connection timeout time in sec */

Definition at line 19 of file sockComm.h.

Function Documentation

◆ addUdpPortToPortList()

int addUdpPortToPortList ( portList_t thisPortList,
int  udpport 
)

Definition at line 1468 of file sockComm.cpp.

References portList_t::portNum.

Referenced by createSrvPortal().

◆ addUdpSockToPortList()

int addUdpSockToPortList ( portList_t thisPortList,
int  udpsock 
)

Definition at line 1487 of file sockComm.cpp.

References portList_t::sock.

Referenced by createSrvPortal().

◆ cliSwitchConnect()

int cliSwitchConnect ( rcComm_t conn)

Definition at line 1438 of file sockComm.cpp.

References rcComm_t::agentState, irods::error::code(), irods::log(), irods::network_factory(), irods::error::ok(), PASS, PROCESSING_STATE, RECEIVING_STATE, rcComm_t::reconnectedSock, sendReconnMsg(), and rcComm_t::sock.

Referenced by cliReconnManager(), readAndProcApiReply(), and sendApiRequest().

Here is the call graph for this function:

◆ connectToRhost()

◆ connectToRhostPortal()

int connectToRhostPortal ( char *  rodsHost,
int  rodsPort,
int  cookie,
int  windowSize 
)

Definition at line 655 of file sockComm.cpp.

References CLOSE_SOCK, connectToRhostWithRaddr(), LOG_ERROR, LOG_NOTICE, myWrite(), NULL, rodsLog(), setSockAddr(), irods.pypyodbc::status, and SYS_PORT_COOKIE_ERR.

Referenced by getFileFromPortal(), initRbudpClient(), putFileToPortal(), and remLocCopy().

Here is the call graph for this function:

◆ connectToRhostWithRaddr()

int connectToRhostWithRaddr ( struct sockaddr_in *  remoteAddr,
int  windowSize,
int  timeoutFlag 
)

Definition at line 810 of file sockComm.cpp.

References irods.pypyodbc::connect, connectToRhostWithTout(), rodsSetSockOpt(), irods.pypyodbc::status, try_twice_to_create_socket(), and USER_SOCK_CONNECT_ERR.

Referenced by cliReconnManager(), connectToRhost(), and connectToRhostPortal().

Here is the call graph for this function:

◆ connectToRhostWithTout()

int connectToRhostWithTout ( struct sockaddr *  sin)

Definition at line 902 of file sockComm.cpp.

References irods.pypyodbc::connect, CONNECT_TIMEOUT_TIME, create_nonblocking_socket(), int(), LOG_DEBUG, LOG_ERROR, LOG_NOTICE, MAX_CONN_RETRY_CNT, NULL, rodsLog(), irods.pypyodbc::status, USER_SOCK_CONNECT_ERR, and USER_SOCK_CONNECT_TIMEDOUT.

Referenced by connectToRhostWithRaddr().

Here is the call graph for this function:

◆ getTcpPortFromPortList()

int getTcpPortFromPortList ( portList_t thisPortList)

Definition at line 1482 of file sockComm.cpp.

References portList_t::portNum.

Referenced by initRbudpClient(), and svrPortalPutGetRbudp().

◆ getTcpSockFromPortList()

int getTcpSockFromPortList ( portList_t thisPortList)

Definition at line 1501 of file sockComm.cpp.

References portList_t::sock.

Referenced by acceptSrvPortal(), svrPortalPutGet(), and svrPortalPutGetRbudp().

◆ getUdpPortFromPortList()

int getUdpPortFromPortList ( portList_t thisPortList)

◆ getUdpSockFromPortList()

int getUdpSockFromPortList ( portList_t thisPortList)

Definition at line 1494 of file sockComm.cpp.

References portList_t::sock.

Referenced by svrPortalPutGetRbudp().

◆ irodsCloseSock()

int irodsCloseSock ( int  sock)

◆ isReadMsgError()

int isReadMsgError ( int  status)

Definition at line 1506 of file sockComm.cpp.

References getIrodsErrno(), irods.pypyodbc::status, SYS_HEADER_READ_LEN_ERR, SYS_HEADER_WRITE_LEN_ERR, and SYS_READ_MSG_BODY_LEN_ERR.

Here is the call graph for this function:

◆ mySockClose()

int mySockClose ( int  sock)

◆ rcReconnect()

int rcReconnect ( rcComm_t **  conn,
char *  newHost,
rodsEnv myEnv,
int  reconnFlag 
)

Definition at line 1547 of file sockComm.cpp.

References clientLogin(), NULL, rcConnect(), rcDisconnect(), rodsEnv::rodsPort, rodsEnv::rodsUserName, rodsEnv::rodsZone, rErrMsg_t::status, and irods.pypyodbc::status.

Referenced by getUtil(), putUtil(), and redirectConnToRescSvr().

Here is the call graph for this function:

◆ redirectConnToRescSvr()

int redirectConnToRescSvr ( rcComm_t **  conn,
dataObjInp_t dataObjInp,
rodsEnv myEnv,
int  reconnFlag 
)

Definition at line 1520 of file sockComm.cpp.

References GET_OPR, LOG_NOTICE, NULL, DataObjInp::oprType, PUT_OPR, rcGetHostForGet(), rcGetHostForPut(), rcReconnect(), rodsLog(), irods.pypyodbc::status, and THIS_ADDRESS.

Referenced by getCollUtil(), and putDirUtil().

Here is the call graph for this function:

◆ rodsSetSockOpt()

int rodsSetSockOpt ( int  sock,
int  tcp_buffer_size 
)

Definition at line 598 of file sockComm.cpp.

References LOG_ERROR, rodsLog(), set_tcp_buffer_size(), and irods.pypyodbc::status.

Referenced by acceptSrvPortal(), connectToRhostWithRaddr(), rsAcceptConn(), and sockOpenForInConn().

Here is the call graph for this function:

◆ rodsSleep()

int rodsSleep ( int  sec,
int  microSec 
)

Definition at line 1270 of file sockComm.cpp.

Referenced by cliReconnManager(), msiSleep(), purgeLockFileWorkerTask(), and serverMain().

◆ rsAcceptConn()

int rsAcceptConn ( rsComm_t svrComm)

Definition at line 407 of file sockComm.cpp.

References LOG_NOTICE, rsComm_t::remoteAddr, rodsLogError(), rodsSetSockOpt(), rsComm_t::sock, irods.pypyodbc::status, SYS_SOCK_ACCEPT_ERR, and rsComm_t::windowSize.

Referenced by serverMain(), and xmsgServerMain().

Here is the call graph for this function:

◆ sendStartupPack()

◆ setConnAddr()

int setConnAddr ( rcComm_t conn)

Definition at line 1015 of file sockComm.cpp.

References rcComm_t::localAddr, rcComm_t::remoteAddr, setLocalAddr(), setRemoteAddr(), and rcComm_t::sock.

Referenced by connectToRhost().

Here is the call graph for this function:

◆ setLocalAddr()

int setLocalAddr ( int  sock,
struct sockaddr_in *  localAddr 
)

Definition at line 1057 of file sockComm.cpp.

References LOG_NOTICE, rodsLog(), and USER_RODS_HOSTNAME_ERR.

Referenced by initRbudpClient(), initRsCommWithStartupPack(), and setConnAddr().

Here is the call graph for this function:

◆ setRemoteAddr()

int setRemoteAddr ( int  sock,
struct sockaddr_in *  remoteAddr 
)

Definition at line 1034 of file sockComm.cpp.

References LOG_NOTICE, rodsLog(), and USER_RODS_HOSTNAME_ERR.

Referenced by initRsCommWithStartupPack(), and setConnAddr().

Here is the call graph for this function:

◆ sockOpenForInConn()

int sockOpenForInConn ( rsComm_t rsComm,
int portNum,
char **  addr,
int  proto 
)

◆ svrSwitchConnect()

int svrSwitchConnect ( rsComm_t rsComm)

Definition at line 1408 of file sockComm.cpp.

References rsComm_t::clientState, irods::error::code(), irods::log(), LOG_NOTICE, irods::network_factory(), irods::error::ok(), PASS, PROCESSING_STATE, RECEIVING_STATE, rsComm_t::reconnectedSock, rodsLog(), sendReconnMsg(), and rsComm_t::sock.

Referenced by readAndProcClientMsg(), reconnManager(), sendApiReply(), svrChkReconnAtReadStart(), and svrChkReconnAtSendStart().

Here is the call graph for this function: