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)  

rcConnect.cpp
Go to the documentation of this file.
1 
4 /* rcConnect.c - client connect call to server
5  *
6  */
7 
8 #include "rcConnect.h"
9 #include "rcGlobalExtern.h"
10 #include "rcMisc.h"
11 
12 #ifdef windows_platform
13 #include "startsock.hpp"
14 #endif
15 
16 #include <boost/asio.hpp>
17 #include <boost/thread.hpp>
18 #include <boost/chrono.hpp>
19 
20 
22 
23 #include "sockComm.h"
24 #include "irods_threads.hpp"
26 #include "rodsError.h"
27 #include <time.h>
28 
29 rcComm_t *
30 rcConnect( const char *rodsHost, int rodsPort, const char *userName, const char *rodsZone,
31  int reconnFlag, rErrMsg_t *errMsg ) {
32  rcComm_t *conn;
33 
34 #ifdef windows_platform
35  if ( 0 != startWinsock() ) {
36  conn = NULL;
37  /*error -34*/
38  return conn;
39  }
40 #endif
41 
42 #ifndef windows_platform
43  if ( reconnFlag != RECONN_TIMEOUT && getenv( RECONNECT_ENV ) != NULL ) {
44  reconnFlag = RECONN_TIMEOUT;
45  }
46 #endif
47 
48  conn = _rcConnect( rodsHost, rodsPort, userName, rodsZone, NULL, NULL,
49  errMsg, 0, reconnFlag );
50 
51  return conn;
52 }
53 
55  const char *rodsHost,
56  int rodsPort,
57  const char *proxyUserName,
58  const char *proxyRodsZone,
59  const char *clientUserName,
60  const char *clientRodsZone,
61  rErrMsg_t *errMsg,
62  int connectCnt,
63  int reconnFlag ) {
64  rcComm_t *conn;
65  int status;
66  char *tmpStr;
67 
68  conn = ( rcComm_t* )malloc( sizeof( rcComm_t ) );
69  memset( conn, 0, sizeof( rcComm_t ) );
70 
71  conn->thread_ctx = ( thread_context* ) malloc( sizeof( thread_context ) );
72  memset( conn->thread_ctx, 0, sizeof( thread_context ) );
73 
74  if ( errMsg != NULL ) {
75  memset( errMsg, 0, sizeof( rErrMsg_t ) );
76  }
77 
78  if ( ( tmpStr = getenv( IRODS_PROT ) ) != NULL ) {
79  conn->irodsProt = ( irodsProt_t )atoi( tmpStr );
80 
81  if (conn->irodsProt != NATIVE_PROT && conn->irodsProt != XML_PROT) {
82  rodsLog(LOG_ERROR, "Invalid protocol value.");
83  return nullptr;
84  }
85  }
86  else {
87  conn->irodsProt = NATIVE_PROT;
88  }
89 
90  status = setUserInfo( proxyUserName, proxyRodsZone,
91  clientUserName, clientRodsZone, &conn->clientUser, &conn->proxyUser );
92 
93  if ( status < 0 ) {
94  if ( errMsg != NULL ) {
95  errMsg->status = status;
96  snprintf( errMsg->msg, ERR_MSG_LEN - 1,
97  "_rcConnect: setUserInfo failed\n" );
98  }
99  if ( conn->thread_ctx != NULL ) {
100  delete conn->thread_ctx->reconnThr;
101  delete conn->thread_ctx->lock;
102  delete conn->thread_ctx->cond;
103  free( conn->thread_ctx );
104  }
105  free( conn );
106  return NULL;
107  }
108 
109  status = setRhostInfo( conn, rodsHost, rodsPort );
110 
111  if ( status < 0 ) {
112  if ( errMsg != NULL ) {
114  "_rcConnect: setRhostInfo error, IRODS_HOST is probably not set correctly" );
115  errMsg->status = status;
116  snprintf( errMsg->msg, ERR_MSG_LEN - 1,
117  "_rcConnect: setRhostInfo failed\n" );
118  }
119  if ( conn->thread_ctx != NULL ) {
120  delete conn->thread_ctx->reconnThr;
121  delete conn->thread_ctx->lock;
122  delete conn->thread_ctx->cond;
123  free( conn->thread_ctx );
124  }
125  free( conn );
126  return NULL;
127  }
128  status = connectToRhost( conn, connectCnt, reconnFlag );
129 
130  if ( status < 0 ) {
132  /* timed out. try again */
134  "_rcConnect: connectToRhost timed out, retrying" );
135  status = connectToRhost( conn, connectCnt, reconnFlag );
136  }
137  }
138 
139  if ( status < 0 ) {
141  "_rcConnect: connectToRhost error, server on %s:%d is probably down",
142  conn->host, conn->portNum );
143  if ( errMsg != NULL ) {
144  errMsg->status = status;
145  snprintf( errMsg->msg, ERR_MSG_LEN - 1,
146  "_rcConnect: connectToRhost failed\n" );
147  }
148  if ( conn->thread_ctx != NULL ) {
149  delete conn->thread_ctx->reconnThr;
150  delete conn->thread_ctx->lock;
151  delete conn->thread_ctx->cond;
152  free( conn->thread_ctx );
153  }
154  free( conn );
155  return NULL;
156  }
157 
158 #ifndef windows_platform
159  if ( reconnFlag == RECONN_TIMEOUT &&
160  conn->svrVersion != NULL &&
161  conn->svrVersion->reconnPort > 0 ) {
162  if ( isLoopbackAddress( conn->svrVersion->reconnAddr ) ||
163  strcmp( conn->svrVersion->reconnAddr , "0.0.0.0" ) == 0 ||
164  strcmp( conn->svrVersion->reconnAddr , "localhost" ) ) {
165  /* localhost. just use conn->host */
166  rstrcpy( conn->svrVersion->reconnAddr, conn->host, NAME_LEN );
167  }
168  conn->exit_flg = false;
169  try {
170  conn->thread_ctx->lock = new boost::mutex;
171  conn->thread_ctx->cond = new boost::condition_variable;
172  conn->thread_ctx->reconnThr = new boost::thread( cliReconnManager, conn );
173  }
174  catch ( const boost::thread_resource_error& ) {
175  rodsLog( LOG_ERROR, "failure initializing the boost thread context in _rcConnect" );
176  return NULL;
177  }
178  }
179 #endif
180 
181  return conn;
182 }
183 
184 
185 int
187  const char *proxyUserName, const char *proxyRodsZone,
188  const char *clientUserName, const char *clientRodsZone,
189  userInfo_t *clientUser, userInfo_t *proxyUser ) {
190 
191  rstrcpy( proxyUser->userName, proxyUserName, NAME_LEN );
192  if ( clientUserName != NULL ) {
193  rstrcpy( clientUser->userName, clientUserName, NAME_LEN );
194  }
195  else if ( char * myUserName = getenv( CLIENT_USER_NAME_KEYWD ) ) {
196  rstrcpy( clientUser->userName, myUserName, NAME_LEN );
197  }
198  else {
199  rstrcpy( clientUser->userName, proxyUserName, NAME_LEN );
200  }
201 
202  rstrcpy( proxyUser->rodsZone, proxyRodsZone, NAME_LEN );
203  if ( clientRodsZone != NULL ) {
204  rstrcpy( clientUser->rodsZone, clientRodsZone, NAME_LEN );
205  }
206  else if ( char * myRodsZone = getenv( CLIENT_RODS_ZONE_KEYWD ) ) {
207  rstrcpy( clientUser->rodsZone, myRodsZone, NAME_LEN );
208  }
209  else {
210  rstrcpy( clientUser->rodsZone, proxyRodsZone, NAME_LEN );
211  }
212 
213  return 0;
214 }
215 
216 int
217 setRhostInfo( rcComm_t *conn, const char *rodsHost, int rodsPort ) {
218  int status;
219 
220  if ( rodsHost == NULL || strlen( rodsHost ) == 0 ) {
221  return USER_RODS_HOST_EMPTY;
222  }
223 
224  rstrcpy( conn->host, rodsHost, NAME_LEN );
225  conn->portNum = rodsPort;
226 
227  status = setSockAddr( &conn->remoteAddr, rodsHost, rodsPort );
228 
229  return status;
230 }
231 
232 int
233 setSockAddr( struct sockaddr_in *remoteAddr, const char *rodsHost, int rodsPort ) {
234  const int status = load_in_addr_from_hostname(rodsHost, &remoteAddr->sin_addr);
235  if ( status != 0 ) {
236  return status;
237  }
238 
239  remoteAddr->sin_family = AF_INET;
240  remoteAddr->sin_port = htons( ( unsigned short )( rodsPort ) );
241  return 0;
242 }
243 
244 // =-=-=-=-=-=-=-
245 // request shut down client-server connection
247  rcComm_t* _conn ) {
248  // =-=-=-=-=-=-=-
249  // check for invalid param
250  if ( _conn == NULL ) {
251  return 0;
252  }
253 
254  // =-=-=-=-=-=-=-
255  // create network object to pass to plugin interface
257  irods::error ret = irods::network_factory( _conn, net_obj );
258  if ( !ret.ok() ) {
259  irods::log( PASS( ret ) );
260  return ret.code();
261  }
262 
263  // =-=-=-=-=-=-=-
264  // send disconnect msg to agent
265  ret = sendRodsMsg(
266  net_obj,
268  NULL, NULL, NULL, 0,
269  _conn->irodsProt );
270 #ifdef RODS_CLERVER
271  if ( !ret.ok() ) {
272  irods::log( PASS( ret ) );
273  }
274 #endif
275 
276  // =-=-=-=-=-=-=-
277  // get rods env to pass to client start for policy decisions
278  rodsEnv rods_env;
279  int status = getRodsEnv( &rods_env );
280 
281  // =-=-=-=-=-=-=-
282  // shut down any network plugin activity
283  ret = sockClientStop( net_obj, &rods_env );
284  if ( !ret.ok() ) {
285  irods::log( PASS( ret ) );
286  }
287 
288  net_obj->to_client( _conn );
289 
290  close( _conn->sock );
291 
292 
293  _conn->exit_flg = true; //
294  if ( _conn->thread_ctx->reconnThr ) {
295  try {
296  // force an interruption point
297  _conn->exit_flg = true;
298  bool val = _conn->thread_ctx->reconnThr->try_join_for(
299  boost::chrono::seconds(
300  2 ) );
301  if ( true != val ) {
302  // do not error out to client
303  }
304 
305  }
306  catch ( const boost::thread_interrupted& ) {
307  rodsLog( LOG_ERROR, "Thread encountered interrupt." );
309  }
310  catch ( const boost::thread_resource_error& ) {
311  rodsLog( LOG_ERROR, "Threads exceed maximum supported concurrent threads" );
313  }
314  }
315 
316  status = freeRcComm( _conn );
317 
318  return status;
319 
320 } // rcDisconnect
321 
322 int
324  int status;
325 
326  if ( conn == NULL ) {
327  return 0;
328  }
329 
330  status = cleanRcComm( conn );
331  free( conn );
332 
333  return status;
334 }
335 
336 int
338 
339  if ( conn == NULL ) {
340  return 0;
341  }
342 
343  freeRError( conn->rError );
344  conn->rError = NULL;
345 
346  if ( conn->svrVersion != NULL ) {
347  free( conn->svrVersion );
348  conn->svrVersion = NULL;
349  }
350  if ( conn->thread_ctx != NULL ) {
351  delete conn->thread_ctx->reconnThr;
352  delete conn->thread_ctx->lock;
353  delete conn->thread_ctx->cond;
354  }
355  free( conn->thread_ctx );
356  conn->thread_ctx = NULL;
357 
358  return 0;
359 }
360 
361 rcComm_t *
362 rcConnectXmsg( rodsEnv *myRodsEnv, rErrMsg_t *errMsg ) {
363  rcComm_t *conn;
364 
365  if ( myRodsEnv == NULL ) {
366  fprintf( stderr, "rcConnectXmsg: NULL myRodsEnv input\n" );
367  return NULL;
368  }
369 
370  conn = rcConnect( myRodsEnv->xmsgHost, myRodsEnv->xmsgPort,
371  myRodsEnv->rodsUserName, myRodsEnv->rodsZone, 0, errMsg );
372 
373  return conn;
374 }
375 
376 
377 void
379  struct sockaddr_in remoteAddr;
381  reconnMsg_t *reconnMsgOut = NULL;
382  if ( conn == NULL || conn->svrVersion == NULL ||
383  conn->svrVersion->reconnPort <= 0 ) {
384  return;
385  }
386 
387  conn->reconnTime = time( 0 ) + RECONN_TIMEOUT_TIME;
388 
389  while ( !conn->exit_flg ) { /* JMC */
390  time_t curTime = time( 0 );
391 
392  if ( curTime < conn->reconnTime ) {
393  rodsSleep( conn->reconnTime - curTime, 0 );
394  }
395  boost::unique_lock<boost::mutex> boost_lock;
396  try {
397  boost_lock = boost::unique_lock<boost::mutex>( *conn->thread_ctx->lock );
398  }
399  catch ( const boost::lock_error& ) {
400  rodsLog( LOG_ERROR, "lock_error on unique_lock" );
401  return;
402  }
403  /* need to check clientState */
404  while ( conn->clientState != PROCESSING_STATE ) {
405  /* have to wait until the client stop sending */
408  "cliReconnManager: clientState = %d", conn->clientState );
409  printf( "cliReconnManager: clientState = %d\n", conn->clientState );
410  fflush( stdout );
411  conn->thread_ctx->cond->wait( boost_lock );
412 
413  }
415  "cliReconnManager: Reconnecting clientState = %d",
416  conn->clientState );
417  printf( "cliReconnManager: Reconnecting clientState = %d\n",
418  conn->clientState );
419  fflush( stdout );
420 
422  /* connect to server's reconn thread */
423 
424  const int status = load_in_addr_from_hostname(conn->svrVersion->reconnAddr, &remoteAddr.sin_addr);
425  if (status != 0) {
426  rodsLog(LOG_ERROR, "cliReconnManager: unknown hostname: %s",
427  conn->svrVersion->reconnAddr );
428  return;
429  }
430 
431  remoteAddr.sin_family = AF_INET;
432  remoteAddr.sin_port = htons((unsigned short)conn->svrVersion->reconnPort);
433 
434  conn->reconnectedSock =
435  connectToRhostWithRaddr( &remoteAddr, conn->windowSize, 0 );
436 
437  if ( conn->reconnectedSock < 0 ) {
438  conn->thread_ctx->cond->notify_all();
439  boost_lock.unlock();
441  "cliReconnManager: connect to host %s failed, status = %d",
442  conn->svrVersion->reconnAddr, conn->reconnectedSock );
443  printf( "cliReconnManager: connect to host %s failed, status = %d\n",
444  conn->svrVersion->reconnAddr, conn->reconnectedSock );
445  fflush( stdout );
447  continue;
448  }
449 
450  bzero( &reconnMsg, sizeof( reconnMsg_t ) );
453 
454  // =-=-=-=-=-=-=-
455  // create network object, need to override the socket
456  // with the reconn socket. no way to infer this in the
457  // factory for the client comm
459  irods::error ret = irods::network_factory( conn, net_obj );
460  if ( !ret.ok() ) {
461  irods::log( PASS( ret ) );
462  }
463 
464  net_obj->socket_handle( conn->reconnectedSock ); // repave w/ recon socket
465  ret = sendReconnMsg( net_obj, &reconnMsg );
466  if ( !ret.ok() ) {
467  close( conn->reconnectedSock );
468  conn->reconnectedSock = 0;
469  conn->thread_ctx->cond->notify_all();
470  boost_lock.unlock();
472  "cliReconnManager: sendReconnMsg to host %s failed, status = %d",
473  conn->svrVersion->reconnAddr, ret.code() );
475  continue;
476  }
477 
478  ret = readReconMsg( net_obj, &reconnMsgOut );
479  if ( !ret.ok() ) {
480  close( conn->reconnectedSock );
481  conn->reconnectedSock = 0;
482  conn->thread_ctx->cond->notify_all();
483  boost_lock.unlock();
485  "cliReconnManager: readReconMsg to host %s failed, status = %d",
486  conn->svrVersion->reconnAddr, ret.code() );
488  continue;
489  }
490 
491  conn->agentState = reconnMsgOut->procState;
492  free( reconnMsgOut );
493  reconnMsgOut = NULL;
494  conn->reconnTime = time( 0 ) + RECONN_TIMEOUT_TIME;
495  if ( conn->clientState == PROCESSING_STATE ) {
497  "cliReconnManager: svrSwitchConnect. cliState = %d,agState=%d",
498  conn->clientState, conn->agentState );
499  cliSwitchConnect( conn );
500  }
501  else {
503  "cliReconnManager: Not calling svrSwitchConnect, clientState = %d",
504  conn->clientState );
505  }
506  conn->thread_ctx->cond->notify_all();
507  boost_lock.unlock();
508  }
509 }
510 
511 int
513  if( !conn ) {
514  printf( "cliChkReconnAtSendStart - null conn\n" );
516  }
517  if ( conn->svrVersion != NULL && conn->svrVersion->reconnPort > 0 ) {
518  /* handle reconn */
519  boost::unique_lock<boost::mutex> boost_lock;
520  try {
521  boost_lock = boost::unique_lock<boost::mutex>( *conn->thread_ctx->lock );
522  }
523  catch ( const boost::lock_error& ) {
524  rodsLog( LOG_ERROR, "lock_error on unique_lock" );
525  return SYS_INTERNAL_ERR;
526  }
527  if ( conn->reconnThrState == CONN_WAIT_STATE ) {
529  "cliChkReconnAtSendStart:ThrState=CONN_WAIT_STATE,clientState=%d",
530  conn->clientState );
532 
533  conn->thread_ctx->cond->notify_all();
534  /* wait for reconnManager to get done */
535  conn->thread_ctx->cond->wait( boost_lock );
536 
537  }
538  conn->clientState = SENDING_STATE;
539  boost_lock.unlock();
540  }
541  return 0;
542 }
543 
544 int
546  if ( conn->svrVersion != NULL && conn->svrVersion->reconnPort > 0 ) {
547  /* handle reconn */
548  boost::unique_lock<boost::mutex> boost_lock;
549  try {
550  boost_lock = boost::unique_lock<boost::mutex>( *conn->thread_ctx->lock );
551  }
552  catch ( const boost::lock_error& ) {
553  rodsLog( LOG_ERROR, "lock_error on unique_lock" );
554  return SYS_INTERNAL_ERR;
555  }
557  if ( conn->reconnThrState == CONN_WAIT_STATE ) {
558  conn->thread_ctx->cond->notify_all();
559  }
560 
561  boost_lock.unlock();
562  }
563  return 0;
564 }
565 
566 int
568  if ( conn->svrVersion != NULL && conn->svrVersion->reconnPort > 0 ) {
569  /* handle reconn */
570  boost::unique_lock<boost::mutex> boost_lock;
571  try {
572  boost_lock = boost::unique_lock<boost::mutex>( *conn->thread_ctx->lock );
573  }
574  catch ( const boost::lock_error& ) {
575  rodsLog( LOG_ERROR, "lock_error on unique_lock" );
576  return SYS_INTERNAL_ERR;
577  }
579  boost_lock.unlock();
580  }
581  return 0;
582 }
583 
584 int
586  if ( conn->svrVersion != NULL && conn->svrVersion->reconnPort > 0 ) {
587  /* handle reconn */
588  boost::unique_lock<boost::mutex> boost_lock;
589  try {
590  boost_lock = boost::unique_lock<boost::mutex>( *conn->thread_ctx->lock );
591  }
592  catch ( const boost::lock_error& ) {
593  rodsLog( LOG_ERROR, "lock_error on unique_lock" );
594  return SYS_INTERNAL_ERR;
595  }
597  if ( conn->reconnThrState == CONN_WAIT_STATE ) {
599  "cliChkReconnAtReadEnd:ThrState=CONN_WAIT_STATE, clientState=%d",
600  conn->clientState );
601 
602  conn->thread_ctx->cond->notify_all();
603  /* wait for reconnManager to get done */
604  try {
605  conn->thread_ctx->cond->wait( boost_lock );
606  }
607  catch ( const boost::condition_error& ) {
608  rodsLog( LOG_ERROR, "encountered boost condition_error on wait" );
609  }
610  catch ( const boost::thread_interrupted& ) {
611  rodsLog( LOG_ERROR, "encountered interrupt in wait" );
612  }
613  }
614  boost_lock.unlock();
615  }
616  return 0;
617 }
618 
619 int
620 isLoopbackAddress( const char * ip_address ) {
621  try {
622  return boost::asio::ip::address_v4::from_string( ip_address ).is_loopback();
623  }
624  catch ( ... ) {
625  return false;
626  }
627 }
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
rcComm_t
Definition: rcConnect.h:95
NULL
#define NULL
Definition: rodsDef.h:70
RECONNECT_ENV
#define RECONNECT_ENV
Definition: sockComm.h:27
rcComm_t::reconnTime
time_t reconnTime
Definition: rcConnect.h:113
rcComm_t::agentState
procState_t agentState
Definition: rcConnect.h:116
getRodsEnv
int getRodsEnv(rodsEnv *myRodsEnv)
Definition: getRodsEnv.cpp:112
rErrMsg_t
Definition: rodsError.h:19
rcComm_t::host
char host[64]
Definition: rcConnect.h:97
RODS_DISCONNECT_T
#define RODS_DISCONNECT_T
Definition: rodsDef.h:227
reconnMsg
Definition: rcConnect.h:49
userInfo_t
Definition: rodsUser.h:65
SENDING_STATE
@ SENDING_STATE
Definition: rcConnect.h:44
rcComm_t::exit_flg
volatile int exit_flg
Definition: rcConnect.h:114
rcConnectXmsg
rcComm_t * rcConnectXmsg(rodsEnv *myRodsEnv, rErrMsg_t *errMsg)
Definition: rcConnect.cpp:362
userInfo_t::userName
char userName[64]
Definition: rodsUser.h:66
rcComm_t::proxyUser
userInfo_t proxyUser
Definition: rcConnect.h:103
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
thread_context::cond
boost::condition_variable * cond
Definition: irods_threads.hpp:13
thread_context::reconnThr
boost::thread * reconnThr
Definition: irods_threads.hpp:11
rodsEnv::rodsZone
char rodsZone[64]
Definition: getRodsEnv.h:18
rcComm_t::rError
rError_t * rError
Definition: rcConnect.h:106
version_t::reconnAddr
char reconnAddr[256]
Definition: rodsDef.h:291
rodsSleep
int rodsSleep(int sec, int microSec)
Definition: sockComm.cpp:1270
freeRError
int freeRError(rError_t *myError)
Definition: rcMisc.cpp:170
rErrMsg_t::status
int status
Definition: rodsError.h:20
sendReconnMsg
irods::error sendReconnMsg(irods::network_object_ptr, reconnMsg_t *)
Definition: sockComm.cpp:1366
XML_PROT
@ XML_PROT
Definition: rodsDef.h:149
rcMisc.h
rcConnect.h
irods_threads.hpp
readReconMsg
irods::error readReconMsg(irods::network_object_ptr, reconnMsg_t **)
Definition: sockComm.cpp:1276
setRhostInfo
int setRhostInfo(rcComm_t *conn, const char *rodsHost, int rodsPort)
Definition: rcConnect.cpp:217
rcDisconnect
int rcDisconnect(rcComm_t *_conn)
Definition: rcConnect.cpp:246
rcConnect
rcComm_t * rcConnect(const char *rodsHost, int rodsPort, const char *userName, const char *rodsZone, int reconnFlag, rErrMsg_t *errMsg)
Definition: rcConnect.cpp:30
cliChkReconnAtSendStart
int cliChkReconnAtSendStart(rcComm_t *conn)
Definition: rcConnect.cpp:512
cliChkReconnAtSendEnd
int cliChkReconnAtSendEnd(rcComm_t *conn)
Definition: rcConnect.cpp:545
rcGlobalExtern.h
connectToRhostWithRaddr
int connectToRhostWithRaddr(struct sockaddr_in *remoteAddr, int windowSize, int timeoutFlag)
Definition: sockComm.cpp:810
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
setSockAddr
int setSockAddr(struct sockaddr_in *remoteAddr, const char *rodsHost, int rodsPort)
Definition: rcConnect.cpp:233
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
rodsEnv::rodsUserName
char rodsUserName[64]
Definition: getRodsEnv.h:9
rcComm_t::reconnThrState
procState_t reconnThrState
Definition: rcConnect.h:118
SYS_THREAD_ENCOUNTERED_INTERRUPT
@ SYS_THREAD_ENCOUNTERED_INTERRUPT
Definition: rodsErrorTable.h:213
cliChkReconnAtReadEnd
int cliChkReconnAtReadEnd(rcComm_t *conn)
Definition: rcConnect.cpp:585
SYS_INTERNAL_ERR
@ SYS_INTERNAL_ERR
Definition: rodsErrorTable.h:211
rodsError.h
RECONN_TIMEOUT
#define RECONN_TIMEOUT
Definition: rcConnect.h:36
rcComm_t::remoteAddr
struct sockaddr_in remoteAddr
Definition: rcConnect.h:102
irods_network_factory.hpp
irodsProt_t
irodsProt_t
Definition: rodsDef.h:147
PROCESSING_STATE
@ PROCESSING_STATE
Definition: rcConnect.h:42
irods::error::code
long long code() const
Definition: irods_error.cpp:194
irods::network_factory
irods::error network_factory(rcComm_t *, irods::network_object_ptr &)
Definition: irods_network_factory.cpp:8
RECEIVING_STATE
@ RECEIVING_STATE
Definition: rcConnect.h:43
LOG_DEBUG
#define LOG_DEBUG
Definition: rodsLog.h:23
setUserInfo
int setUserInfo(const char *proxyUserName, const char *proxyRodsZone, const char *clientUserName, const char *clientRodsZone, userInfo_t *clientUser, userInfo_t *proxyUser)
Definition: rcConnect.cpp:186
connectToRhost
int connectToRhost(rcComm_t *conn, int connectCnt, int reconnFlag)
Definition: sockComm.cpp:690
IRODS_PROT
#define IRODS_PROT
Definition: rodsDef.h:248
rcComm_t::clientUser
userInfo_t clientUser
Definition: rcConnect.h:104
getIrodsErrno
int getIrodsErrno(int irodError)
Definition: rcMisc.cpp:3272
freeRcComm
int freeRcComm(rcComm_t *conn)
Definition: rcConnect.cpp:323
cliReconnManager
void cliReconnManager(rcComm_t *conn)
Definition: rcConnect.cpp:378
RECONNECT_SLEEP_TIME
#define RECONNECT_SLEEP_TIME
Definition: sockComm.h:19
USER_RODS_HOST_EMPTY
@ USER_RODS_HOST_EMPTY
Definition: rodsErrorTable.h:233
CONN_WAIT_STATE
@ CONN_WAIT_STATE
Definition: rcConnect.h:45
rErrMsg_t::msg
char msg[1024]
Definition: rodsError.h:21
version_t::cookie
int cookie
Definition: rodsDef.h:292
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
sendRodsMsg
irods::error sendRodsMsg(irods::network_object_ptr, const char *, bytesBuf_t *, bytesBuf_t *, bytesBuf_t *, int, irodsProt_t)
Definition: sockComm.cpp:1221
userInfo_t::rodsZone
char rodsZone[64]
Definition: rodsUser.h:67
rcComm_t::clientState
procState_t clientState
Definition: rcConnect.h:117
irods::log
void log(const error &)
Definition: irods_log.cpp:13
reconnMsg::cookie
int cookie
Definition: rcConnect.h:51
rcComm_t::thread_ctx
struct thread_context * thread_ctx
Definition: rcConnect.h:115
irods::error
Definition: irods_error.hpp:23
cleanRcComm
int cleanRcComm(rcComm_t *conn)
Definition: rcConnect.cpp:337
rodsEnv::xmsgPort
int xmsgPort
Definition: getRodsEnv.h:13
_rcConnect
rcComm_t * _rcConnect(const char *rodsHost, int rodsPort, const char *proxyUserName, const char *proxyRodsZone, const char *clientUserName, const char *clientRodsZone, rErrMsg_t *errMsg, int connectCnt, int reconnFlag)
Definition: rcConnect.cpp:54
cliSwitchConnect
int cliSwitchConnect(rcComm_t *conn)
Definition: sockComm.cpp:1438
SYS_SOCK_READ_TIMEDOUT
@ SYS_SOCK_READ_TIMEDOUT
Definition: rodsErrorTable.h:180
CLIENT_USER_NAME_KEYWD
#define CLIENT_USER_NAME_KEYWD
Definition: rodsUser.h:25
reconnMsg::procState
procState_t procState
Definition: rcConnect.h:52
cliChkReconnAtReadStart
int cliChkReconnAtReadStart(rcComm_t *conn)
Definition: rcConnect.cpp:567
RECONN_TIMEOUT_TIME
#define RECONN_TIMEOUT_TIME
Definition: rcConnect.h:38
irods::network_object_ptr
boost::shared_ptr< network_object > network_object_ptr
Definition: irods_network_object.hpp:78
rcComm_t::portNum
int portNum
Definition: rcConnect.h:99
rodsLogError
void rodsLogError(int level, int errCode, char *formatStr,...)
Definition: rodsLog.cpp:422
rcComm_t::svrVersion
version_t * svrVersion
Definition: rcConnect.h:105
load_in_addr_from_hostname
int load_in_addr_from_hostname(const char *_hostname, struct in_addr *_out)
Definition: rcMisc.cpp:4594
rcComm_t::reconnectedSock
int reconnectedSock
Definition: rcConnect.h:112
NATIVE_PROT
@ NATIVE_PROT
Definition: rodsDef.h:148
sockComm.h
thread_context
Definition: irods_threads.hpp:10
rcComm_t::irodsProt
irodsProt_t irodsProt
Definition: rcConnect.h:96
rcComm_t::windowSize
int windowSize
Definition: rcConnect.h:111
rstrcpy
char * rstrcpy(char *dest, const char *src, int maxLen)
Definition: stringOpr.cpp:51
isLoopbackAddress
int isLoopbackAddress(const char *ip_address)
Definition: rcConnect.cpp:620
rodsEnv::xmsgHost
char xmsgHost[64]
Definition: getRodsEnv.h:12
rodsEnv
Definition: getRodsEnv.h:8
version_t::reconnPort
int reconnPort
Definition: rodsDef.h:290
NAME_LEN
#define NAME_LEN
Definition: rodsDef.h:55
sockCommNetworkInterface.hpp
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
thread_context::lock
boost::mutex * lock
Definition: irods_threads.hpp:12
sockClientStop
irods::error sockClientStop(irods::network_object_ptr, rodsEnv *)
Definition: sockComm.cpp:80
ERR_MSG_LEN
#define ERR_MSG_LEN
Definition: rodsError.h:16
rcComm_t::sock
int sock
Definition: rcConnect.h:98
CLIENT_RODS_ZONE_KEYWD
#define CLIENT_RODS_ZONE_KEYWD
Definition: rodsUser.h:26