00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 #ifndef INFOREPOMULTICASTRESPONDER_H
00009 #define INFOREPOMULTICASTRESPONDER_H
00010 
00011 #include  "ace/pre.h"
00012 
00013 #include "federator_export.h"
00014 #include "tao/ORB.h"
00015 
00016 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00017 # pragma once
00018 #endif 
00019 
00020 #include "ace/INET_Addr.h"
00021 #include "ace/SOCK_Dgram_Mcast.h"
00022 #include "ace/Reactor.h"
00023 #include "ace/SString.h"
00024 
00025 namespace OpenDDS {
00026 namespace Federator {
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 class OpenDDS_Federator_Export InfoRepoMulticastResponder : public ACE_Event_Handler {
00039 public:
00040 
00041   InfoRepoMulticastResponder();
00042 
00043 
00044   virtual ~InfoRepoMulticastResponder();
00045 
00046 
00047   int init(
00048     CORBA::ORB_ptr orb,
00049     u_short port,
00050     const char *mcast_addr);
00051 
00052 
00053 
00054   int init(
00055     CORBA::ORB_ptr orb,
00056     const char *mcast_addr);
00057 
00058 
00059   virtual int handle_input(ACE_HANDLE n);
00060 
00061 
00062   virtual int handle_timeout(const ACE_Time_Value &tv,
00063                              const void *arg);
00064 
00065 
00066   virtual ACE_HANDLE get_handle() const;
00067 
00068 private:
00069 
00070   int common_init(
00071     CORBA::ORB_ptr orb);
00072 
00073 
00074   bool initialized_;
00075 
00076 
00077   CORBA::ORB_var orb_;
00078 
00079 
00080   ACE_SOCK_Dgram_Mcast mcast_dgram_;
00081 
00082 
00083   ACE_INET_Addr mcast_addr_;
00084 
00085 
00086   ACE_INET_Addr response_addr_;
00087 
00088 
00089   ACE_SOCK_Dgram response_;
00090 
00091   ACE_CString mcast_nic_;
00092 };
00093 
00094 } 
00095 } 
00096 
00097 #include  "ace/post.h"
00098 
00099 #endif