MCast.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   MCast.h
00006  *
00007  *  $Id: MCast.h 73791 2006-07-27 20:54:56Z wotte $
00008  *
00009  *  @author Nagarajan Surendran <naga@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef TAO_AV_MCAST_H
00015 #define TAO_AV_MCAST_H
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "orbsvcs/AV/FlowSpec_Entry.h"
00019 #include "orbsvcs/AV/Protocol_Factory.h"
00020 #include "ace/INET_Addr.h"
00021 #include "ace/SOCK_Dgram_Mcast.h"
00022 
00023 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00024 
00025 class TAO_AV_UDP_MCast_Flow_Handler;
00026 
00027 /**
00028  * @class TAO_AV_UDP_MCast_Transport
00029  * @brief A transport abstraction for Multicast dgram sockets.
00030  *        Uses the ACE_SOCK_Dgram_Mcast to send data.
00031  */
00032 class TAO_AV_UDP_MCast_Transport
00033   :public TAO_AV_Transport
00034 {
00035 
00036 public:
00037   TAO_AV_UDP_MCast_Transport (void);
00038 
00039   TAO_AV_UDP_MCast_Transport (TAO_AV_UDP_MCast_Flow_Handler *handler);
00040 
00041   virtual ~TAO_AV_UDP_MCast_Transport (void);
00042 
00043   virtual int open (ACE_Addr *address);
00044 
00045   virtual int close (void);
00046 
00047   virtual int mtu (void);
00048 
00049   /// Write the complete Message_Block chain to the connection.
00050   virtual ACE_Addr *get_peer_addr (void);
00051   virtual ACE_Addr *get_local_addr (void);
00052   virtual ssize_t send (const ACE_Message_Block *mblk,
00053                         ACE_Time_Value *s = 0);
00054 
00055   /// Write the contents of the buffer of length len to the connection.
00056   virtual ssize_t send (const char *buf,
00057                         size_t len,
00058                         ACE_Time_Value *s = 0);
00059 
00060   /// Write the contents of iovcnt iovec's to the connection.
00061   virtual ssize_t send (const iovec *iov,
00062                         int iovcnt,
00063                         ACE_Time_Value *s = 0);
00064 
00065   /// Read len bytes from into buf.
00066   virtual ssize_t recv (char *buf,
00067                         size_t len,
00068                         ACE_Time_Value *s = 0);
00069 
00070   /// Read len bytes from into buf using flags.
00071   virtual ssize_t recv (char *buf,
00072                         size_t len,
00073                         int flags,
00074                         ACE_Time_Value *s = 0);
00075 
00076   ///  Read received data into the iovec buffers.
00077   virtual ssize_t recv (iovec *iov,
00078                         int iovcnt,
00079                         ACE_Time_Value *s = 0);
00080 protected:
00081   TAO_AV_UDP_MCast_Flow_Handler *handler_;
00082   ACE_INET_Addr peer_addr_;
00083   ACE_INET_Addr local_addr_;
00084 };
00085 
00086 /**
00087  * @class TAO_AV_UDP_MCast_Flow_Handler
00088  * @brief Flow Handler for data sent over multicast sockets.
00089  */
00090 class TAO_AV_UDP_MCast_Flow_Handler
00091   :public virtual TAO_AV_Flow_Handler,
00092    public virtual ACE_Event_Handler
00093 {
00094 public:
00095   /// Ctor
00096   /// Dtor
00097   TAO_AV_UDP_MCast_Flow_Handler (void);
00098   virtual ~TAO_AV_UDP_MCast_Flow_Handler (void);
00099   virtual ACE_HANDLE get_handle (void) const;
00100   virtual int handle_input (ACE_HANDLE fd);
00101   virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg = 0);
00102   ACE_SOCK_Dgram_Mcast *get_mcast_socket (void) const;
00103   virtual ACE_Event_Handler* event_handler (void){ return this; }
00104   void set_peer_addr (ACE_INET_Addr *peer_addr);
00105 protected:
00106   ACE_INET_Addr *peer_addr_;
00107   ACE_SOCK_Dgram_Mcast *dgram_mcast_;
00108 };
00109 
00110 TAO_END_VERSIONED_NAMESPACE_DECL
00111 
00112 #if defined(__ACE_INLINE__)
00113 #include "orbsvcs/AV/MCast.inl"
00114 #endif /* __ACE_INLINE__ */
00115 
00116 #include /**/ "ace/post.h"
00117 #endif /* TAO_AV_MCAST_H */

Generated on Tue Feb 2 17:47:49 2010 for TAO_AV by  doxygen 1.4.7