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)  

irods_network_factory.cpp
Go to the documentation of this file.
1 // =-=-=-=-=-=-=-
4 
5 namespace irods {
6 // super basic free factory function to create either a tcp
7 // object or an ssl object based on whether ssl has been enabled
9  rcComm_t* _comm,
11  // param check
12  if ( !_comm ) {
13  return ERROR( SYS_INVALID_INPUT_PARAM, "null comm ptr" );
14  }
15 
16  // currently our only criteria on the network object
17  // is whether SSL has been enabled. if it has then we
18  // want an ssl object which will resolve to an ssl
19  // network plugin
21  _ptr.reset( new irods::ssl_object( *_comm ) );
22  }
23  // otherwise we just need a tcp object
24  else {
25  _ptr.reset( new irods::tcp_object( *_comm ) );
26  }
27 
28  return SUCCESS();
29 
30  } // network_factory
31 
32 // =-=-=-=-=-=-=-
33 // version for server connection as well
35  rsComm_t* _comm,
37 
38  // param check
39  if ( !_comm ) {
40  return ERROR( SYS_INVALID_INPUT_PARAM, "null comm ptr" );
41  }
42 
43  // currently our only criteria on the network object
44  // is whether SSL has been enabled. if it has then we
45  // want an ssl object which will resolve to an ssl
46  // network plugin
48  _ptr.reset( new irods::ssl_object( *_comm ) );
49  }
50  // otherwise we just need a tcp object
51  else {
52  _ptr.reset( new irods::tcp_object( *_comm ) );
53  }
54 
55  return SUCCESS();
56 
57  } // network_factory
58 
59 }; // namespace irods
irods::tcp_object
Definition: irods_tcp_object.hpp:14
rcComm_t
Definition: rcConnect.h:95
irods::ssl_object
Definition: irods_ssl_object.hpp:20
rsComm_t
Definition: rcConnect.h:145
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
SUCCESS
#define SUCCESS()
Definition: irods_error.hpp:121
irods_network_factory.hpp
irods::network_factory
irods::error network_factory(rcComm_t *, irods::network_object_ptr &)
Definition: irods_network_factory.cpp:8
irods
Definition: apiHandler.hpp:35
rsComm_t::negotiation_results
char negotiation_results[(1024+64)]
Definition: rcConnect.h:185
irods::CS_NEG_USE_SSL
const std::string CS_NEG_USE_SSL("CS_NEG_USE_SSL")
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
irods::error
Definition: irods_error.hpp:23
irods::network_object_ptr
boost::shared_ptr< network_object > network_object_ptr
Definition: irods_network_object.hpp:78
irods_client_server_negotiation.hpp
rcComm_t::negotiation_results
char negotiation_results[(1024+64)]
Definition: rcConnect.h:125