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
Go to the documentation of this file.
1 
3 /* sockComm.h - header file for sockComm.c
4  */
5 
6 #ifndef SOCK_COMM_H__
7 #define SOCK_COMM_H__
8 
9 // =-=-=-=-=-=-=
10 // irods includes
11 #include "rodsDef.h"
12 #include "rcConnect.h"
13 #include "rodsPackInstruct.h"
14 
15 #define MAX_LISTEN_QUE 50
16 #define DEF_NUMBER_SVR_PORT 200 /* default number of of server ports */
17 #define CONNECT_TIMEOUT_TIME 100 /* connection timeout time in sec */
18 #define RECONNECT_WAIT_TIME 100 /* re-connection timeout time in sec */
19 #define RECONNECT_SLEEP_TIME 300 /* re-connection sleep time in sec */
20 #define MAX_RECONN_RETRY_CNT 4 /* max connect retry count */
21 #define MAX_CONN_RETRY_CNT 3 /* max connect retry count */
22 #define CONNECT_SLEEP_TIME 200000 /* connect sleep time in uSec */
23 
24 #define READ_STARTUP_PACK_TOUT_SEC 100 /* 1 sec timeout */
25 #define READ_VERSION_TOUT_SEC 100 /* 10 sec timeout */
26 
27 #define RECONNECT_ENV "irodsReconnect" /* reconnFlag will be set to
28 * RECONN_TIMEOUT if this
29 * env is set */
30 
31 /* definition for socket close function */
32 #define READING_FROM_CLI 0
33 #define PROCESSING_API 1
34 
35 #ifdef _WIN32
36 #define CLOSE_SOCK closesocket
37 #else
38 #define CLOSE_SOCK close
39 #endif
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 // =-=-=-=-=-=-=-
46 // other legacy functions
47 int sockOpenForInConn( rsComm_t *rsComm, int *portNum, char **addr, int proto );
48 int rodsSetSockOpt( int sock, int tcp_buffer_size );
49 int connectToRhost( rcComm_t *conn, int connectCnt, int reconnFlag );
50 int connectToRhostWithRaddr( struct sockaddr_in *remoteAddr, int windowSize,
51  int timeoutFlag );
52 int connectToRhostWithTout( struct sockaddr *sin );
53 int rodsSleep( int sec, int microSec );
54 int setConnAddr( rcComm_t *conn );
55 int setRemoteAddr( int sock, struct sockaddr_in *remoteAddr );
56 int setLocalAddr( int sock, struct sockaddr_in *localAddr );
57 int sendStartupPack( rcComm_t *conn, int connectCnt, int reconnFlag );
58 int connectToRhostPortal( char *rodsHost, int rodsPort, int cookie, int windowSize );
59 int rsAcceptConn( rsComm_t *svrComm );
60 int irodsCloseSock( int sock );
61 int addUdpPortToPortList( portList_t *thisPortList, int udpport );
62 int getUdpPortFromPortList( portList_t *thisPortList );
63 int getTcpPortFromPortList( portList_t *thisPortList );
64 int addUdpSockToPortList( portList_t *thisPortList, int udpsock );
65 int getUdpSockFromPortList( portList_t *thisPortList );
66 int getTcpSockFromPortList( portList_t *thisPortList );
67 int isReadMsgError( int status );
68 int svrSwitchConnect( rsComm_t *rsComm );
69 int cliSwitchConnect( rcComm_t *conn );
70 int redirectConnToRescSvr( rcComm_t **conn, dataObjInp_t *dataObjInp, rodsEnv *myEnv, int reconnFlag );
71 int rcReconnect( rcComm_t **conn, char *newHost, rodsEnv *myEnv, int reconnFlag );
72 int mySockClose( int sock ); // server stop fcn <==> rsAccept?
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif /* SOCK_COMM_H__ */
rcComm_t
Definition: rcConnect.h:95
rsComm_t
Definition: rcConnect.h:145
rodsPackInstruct.h
connectToRhostWithTout
int connectToRhostWithTout(struct sockaddr *sin)
Definition: sockComm.cpp:902
setRemoteAddr
int setRemoteAddr(int sock, struct sockaddr_in *remoteAddr)
Definition: sockComm.cpp:1034
sockOpenForInConn
int sockOpenForInConn(rsComm_t *rsComm, int *portNum, char **addr, int proto)
Definition: sockComm.cpp:289
irodsCloseSock
int irodsCloseSock(int sock)
rodsSleep
int rodsSleep(int sec, int microSec)
Definition: sockComm.cpp:1270
rcConnect.h
getUdpPortFromPortList
int getUdpPortFromPortList(portList_t *thisPortList)
Definition: sockComm.cpp:1475
setLocalAddr
int setLocalAddr(int sock, struct sockaddr_in *localAddr)
Definition: sockComm.cpp:1057
rodsSetSockOpt
int rodsSetSockOpt(int sock, int tcp_buffer_size)
Definition: sockComm.cpp:598
addUdpSockToPortList
int addUdpSockToPortList(portList_t *thisPortList, int udpsock)
Definition: sockComm.cpp:1487
connectToRhostWithRaddr
int connectToRhostWithRaddr(struct sockaddr_in *remoteAddr, int windowSize, int timeoutFlag)
Definition: sockComm.cpp:810
connectToRhostPortal
int connectToRhostPortal(char *rodsHost, int rodsPort, int cookie, int windowSize)
Definition: sockComm.cpp:655
getUdpSockFromPortList
int getUdpSockFromPortList(portList_t *thisPortList)
Definition: sockComm.cpp:1494
mySockClose
int mySockClose(int sock)
Definition: sockComm.cpp:1573
redirectConnToRescSvr
int redirectConnToRescSvr(rcComm_t **conn, dataObjInp_t *dataObjInp, rodsEnv *myEnv, int reconnFlag)
Definition: sockComm.cpp:1520
connectToRhost
int connectToRhost(rcComm_t *conn, int connectCnt, int reconnFlag)
Definition: sockComm.cpp:690
rodsDef.h
DataObjInp
Definition: dataObjInpOut.h:65
portList_t
Definition: dataObjInpOut.h:29
rcReconnect
int rcReconnect(rcComm_t **conn, char *newHost, rodsEnv *myEnv, int reconnFlag)
Definition: sockComm.cpp:1547
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
setConnAddr
int setConnAddr(rcComm_t *conn)
Definition: sockComm.cpp:1015
getTcpSockFromPortList
int getTcpSockFromPortList(portList_t *thisPortList)
Definition: sockComm.cpp:1501
svrSwitchConnect
int svrSwitchConnect(rsComm_t *rsComm)
Definition: sockComm.cpp:1408
sendStartupPack
int sendStartupPack(rcComm_t *conn, int connectCnt, int reconnFlag)
Definition: sockComm.cpp:1079
cliSwitchConnect
int cliSwitchConnect(rcComm_t *conn)
Definition: sockComm.cpp:1438
rsAcceptConn
int rsAcceptConn(rsComm_t *svrComm)
Definition: sockComm.cpp:407
addUdpPortToPortList
int addUdpPortToPortList(portList_t *thisPortList, int udpport)
Definition: sockComm.cpp:1468
getTcpPortFromPortList
int getTcpPortFromPortList(portList_t *thisPortList)
Definition: sockComm.cpp:1482
rodsEnv
Definition: getRodsEnv.h:8
isReadMsgError
int isReadMsgError(int status)
Definition: sockComm.cpp:1506