diff options
author | Chris Cleeland <chris.cleeland@gmail.com> | 1997-08-08 21:52:16 +0000 |
---|---|---|
committer | Chris Cleeland <chris.cleeland@gmail.com> | 1997-08-08 21:52:16 +0000 |
commit | ee35246bbf23e5bee551ef7c21c5294233ca29ff (patch) | |
tree | a5cb80a5ba3067b98404629ef328e3c97f848fac /TAO/tao/client_factory.cpp | |
parent | 06e4dabf7dd1144d7a6ed11ca05a1325160ed84a (diff) | |
download | ATCD-ee35246bbf23e5bee551ef7c21c5294233ca29ff.tar.gz |
Checkpoint commit of service config stuff. Hasn't even been compiled,
so don't count on it working!
Diffstat (limited to 'TAO/tao/client_factory.cpp')
-rw-r--r-- | TAO/tao/client_factory.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/TAO/tao/client_factory.cpp b/TAO/tao/client_factory.cpp new file mode 100644 index 00000000000..cffc8fadf10 --- /dev/null +++ b/TAO/tao/client_factory.cpp @@ -0,0 +1,62 @@ +// ============================================================================ +// +// = LIBRARY +// TAO +// +// = FILENAME +// client_factory.cpp +// +// = AUTHOR +// Chris Cleeland +// +// = VERSION +// $Id$ +// ============================================================================ + +#if !defined(__ACE_INLINE__) +# include "client_factory.i" +#endif + +// Template specializations which allow the cached connection manager +// to work better. + +size_t +ACE_Hash_Addr<ACE_INET_Addr, TAO_Client_Connection_Handler>::hash_i (const ACE_INET_Addr &addr) const +{ + return addr.get_ip_address () + addr.get_port_number (); +} + +int +ACE_Hash_Addr<ACE_INET_Addr, TAO_Client_Connection_Handler>::compare_i (const ACE_INET_Addr &a1, + const ACE_INET_Addr &a2) const +{ + return a1 != a2; +} + +int +TAO_Client_Connection_Handler::open(void *) +{ + // Here is where we could enable all sorts of things such as + // nonblock I/O, sock buf sizes, TCP no-delay, etc. + + const int MAX_SOCK_BUF_SIZE = 65536; + if (this->peer ().set_option(SOL_SOCKET, SO_SNDBUF, (void + *)&MAX_SOCK_BUF_SIZE, + sizeof(MAX_SOCK_BUF_SIZE)) == -1) + return -1; + if (this->peer ().set_option(SOL_SOCKET, SO_RCVBUF, (void + *)&MAX_SOCK_BUF_SIZE, + sizeof (MAX_SOCK_BUF_SIZE)) == -1) + return -1; + + // For now, we just return success + return 0; +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Strategy_Connector<TAO_Client_Connection_Handler, ACE_SOCK_CONNECTOR>; +template class ACE_NOOP_Creation_Strategy<TAO_Client_Connection_Handler>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Strategy_Connector<TAO_Client_Connection_Handler, ACE_SOCK_CONNECTOR> +#pragma instantiate ACE_NOOP_Creation_Strategy<TAO_Client_Connection_Handler> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ |