diff options
author | sergio <sergio@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-19 12:02:35 +0000 |
---|---|---|
committer | sergio <sergio@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-19 12:02:35 +0000 |
commit | 8f9875cb32f7f94590cbcda98d7ce22b77886936 (patch) | |
tree | ca619b9f9c8524ff09b5bdc74d2fe2e098460d03 /TAO | |
parent | 5e5b7eafba2d2eb0c5a38f3acf396e1f9ad5611a (diff) | |
download | ATCD-8f9875cb32f7f94590cbcda98d7ce22b77886936.tar.gz |
*** empty log message ***
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/orbsvcs/tests/Logger/ior_multicast.cpp | 83 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/Logger/ior_multicast.h | 61 |
2 files changed, 0 insertions, 144 deletions
diff --git a/TAO/orbsvcs/tests/Logger/ior_multicast.cpp b/TAO/orbsvcs/tests/Logger/ior_multicast.cpp deleted file mode 100644 index e931c5f74a3..00000000000 --- a/TAO/orbsvcs/tests/Logger/ior_multicast.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/orbsvcs/bin/Logger -// -// = FILENAME -// ior_multicast.cpp -// -// = DESCRIPTION -// Listens to multicast address for client requests for ior's. -// -// = AUTHORS -// Sergio Flores-Gaitan -// -// ============================================================================ - -#include "ior_multicast.h" - -ACE_HANDLE -IOR_Multicast::get_handle (void) const -{ - return this->mcast_dgram_.get_handle (); -} - -IOR_Multicast::IOR_Multicast (char * ior, - u_short port, - const char *mcast_addr, - u_short response_port) - : ior_ (ior), - mcast_addr_ (port, mcast_addr), - SERVICE_RESPONSE_UDP_PORT_ (response_port), - response_ (response_addr_) -{ - // Use ACE_SOCK_Dgram_Mcast factory to subscribe to multicast group. - if (this->mcast_dgram_.subscribe (this->mcast_addr_) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", "subscribe")); -} - -// destructor - -IOR_Multicast::~IOR_Multicast (void) -{ - this->mcast_dgram_.unsubscribe (); -} - -int -IOR_Multicast::handle_timeout (const ACE_Time_Value &, - const void *arg) -{ - return 0; -} - -int -IOR_Multicast::handle_input (ACE_HANDLE) -{ - ssize_t retcode = - this->mcast_dgram_.recv (this->buf_, - BUFSIZ, - this->remote_addr_); - - if (retcode == -1) - return -1; - - ACE_DEBUG ((LM_ERROR, "@@ Received multicast @@\n")); - - // @@ validate data string received is from a valid client here - // @@ Probably not needed - - this->remote_addr_.set_port_number (this->SERVICE_RESPONSE_UDP_PORT_); - retcode = response_.send (this->ior_, - ACE_OS::strlen (this->ior_) + 1, - this->remote_addr_, - 0); - - ACE_DEBUG ((LM_ERROR, "ior_ '%s' sent.\nretcode=%d\n", this->ior_, retcode)); - - if (retcode == -1) - return -1; - - return 0; -} diff --git a/TAO/orbsvcs/tests/Logger/ior_multicast.h b/TAO/orbsvcs/tests/Logger/ior_multicast.h deleted file mode 100644 index 3214da36517..00000000000 --- a/TAO/orbsvcs/tests/Logger/ior_multicast.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/orbsvcs/bin/Logger -// -// = FILENAME -// ior_multicast.h -// -// = DESCRIPTION -// Listens to multicast address for client requests for ior's. -// -// = AUTHORS -// Sergio Flores-Gaitan -// -// ============================================================================ - -#if !defined (IOR_MULTICAST_H) -#define IOR_MULTICAST_H - -#include "ace/INET_Addr.h" -#include "ace/SOCK_Dgram_Mcast.h" -#include "ace/Reactor.h" - -// defines -#define DEFAULT_LOGGER_SERVER_REQUEST_PORT 10030 -#define DEFAULT_LOGGER_SERVER_REPLY_PORT 10031 -#define DEFAULT_LOGGER_SERVER_MULTICAST_ADDR ACE_DEFAULT_MULTICAST_ADDR -#define DEFAULT_LOGGER_SERVER_TIMEOUT 5 - -class IOR_Multicast : public ACE_Event_Handler -{ -public: - IOR_Multicast (char * ior, - u_short port, - const char *mcast_addr, - u_short response_port); - ~IOR_Multicast (void); - - virtual int handle_input (ACE_HANDLE fd); - virtual int handle_timeout (const ACE_Time_Value &tv, - const void *arg); - - virtual ACE_HANDLE get_handle (void) const; - -private: - char buf_[BUFSIZ]; - - ACE_SOCK_Dgram_Mcast mcast_dgram_; - ACE_INET_Addr remote_addr_; - ACE_INET_Addr mcast_addr_; - char * ior_; - const u_short SERVICE_RESPONSE_UDP_PORT_; - ACE_INET_Addr response_addr_; - ACE_SOCK_Dgram response_; - -}; - -#endif /* IOR_MULTICAST_H */ |