diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-12-26 06:49:59 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-12-26 06:49:59 +0000 |
commit | 2b8154096bbc803712441f6fb7008318404d9c5a (patch) | |
tree | 04bf86752fb554217ff2f6e6a31a70c570e75dab /TAO/orbsvcs/orbsvcs/Event/EC_Gateway_UDP.h | |
parent | 902033831247789f0e4b3ba93ec6aea5b07ec557 (diff) | |
download | ATCD-2b8154096bbc803712441f6fb7008318404d9c5a.tar.gz |
ChangeLogTag:Tue Dec 25 22:48:32 2001 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Event/EC_Gateway_UDP.h')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/EC_Gateway_UDP.h | 148 |
1 files changed, 0 insertions, 148 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_UDP.h b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_UDP.h index 8b01c24f5ad..ca2b9d534a3 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_UDP.h +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_UDP.h @@ -69,154 +69,6 @@ class TAO_ECG_UDP_Out_Endpoint; -/** - * @class TAO_ECG_UDP_Sender - * - * @brief Send events received from a "local" EC using UDP. - * - * This class connect as a consumer to an EventChannel - * and it sends the events using UDP, the UDP address can be a - * normal IP address or it can be a multicast group. - * The UDP address is obtained from a RtecUDPAdmin::AddrServer - * class. - * It marshalls the events using TAO CDR classes. - * - * <H2>MESSAGE FORMAT</H2> - * The messages header are encapsulated using CDR, with the - * following format: - * struct Header { - * octet byte_order_flags; - * // bit 0 represents the byte order as in GIOP 1.1 - * // bit 1 is set if this is the last fragment - * unsigned long request_id; - * // The request ID, senders must not send two requests with - * // the same ID, senders can be distinguished using recvfrom.. - * unsigned long request_size; - * // The size of this request, this can be used to pre-allocate - * // the request buffer. - * unsgined long fragment_size; - * // The size of this fragment, excluding the header... - * unsigned long fragment_offset; - * // Where does this fragment fit in the complete message... - * unsigned long fragment_id; - * // The ID of this fragment... - * unsigned long fragment_count; - * // The total number of fragments to expect in this request - * - * // @todo This could be eliminated if efficient reassembly - * // could be implemented without it. - * octet padding[4]; - * - * // Ensures the header ends at an 8-byte boundary. - * }; // size (in CDR stream) = 32 - */ -class TAO_RTEvent_Export TAO_ECG_UDP_Sender : public POA_RtecEventComm::PushConsumer -{ -public: - TAO_ECG_UDP_Sender (void); - - enum { - ECG_HEADER_SIZE = 32, - ECG_MIN_MTU = 32 + 8, - ECG_MAX_MTU = 65536, // Really optimistic... - ECG_DEFAULT_MTU = 1024 - }; - - /// Get the local endpoint used to send the events. - int get_local_addr (ACE_INET_Addr& addr); - - /** - * To do its job this class requires to know the local EC it will - * connect to; it also requires to build an RT_Info for the local - * scheduler. - * It only keeps a copy of its SupplierProxy, used for later - * connection and disconnections. - * @todo part of the RT_Info is hardcoded, we need to make it - * parametric. - */ - void init (RtecEventChannelAdmin::EventChannel_ptr lcl_ec, - RtecUDPAdmin::AddrServer_ptr addr_server, - TAO_ECG_UDP_Out_Endpoint *endpoint - TAO_ENV_ARG_DECL_WITH_DEFAULTS); - - /** - * The sender may need to fragment the message, otherwise the - * network may drop the packets. - * Setting the MTU can fail if the value is too small (at least the - * header + 8 bytes must fit). - */ - int mtu (CORBA::ULong mtu); - CORBA::ULong mtu (void) const; - - /// Disconnect and shutdown the sender, no further connections will - /// work unless init() is called again. - void shutdown (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS); - - /// Connect (or reconnect) to the EC with the given subscriptions. - void open (RtecEventChannelAdmin::ConsumerQOS &sub - TAO_ENV_ARG_DECL_WITH_DEFAULTS); - - /// Disconnect from the EC, but reconnection is still possible. - void close (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS); - - /// The PushConsumer methods. - virtual void disconnect_push_consumer (TAO_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - virtual void push (const RtecEventComm::EventSet &events - TAO_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -private: - /// Return the datagram... - ACE_SOCK_Dgram& dgram (void); - - /** - * Send one fragment, the first entry in the iovec is used to send - * the header, the rest of the iovec array should contain pointers - * to the actual data. - */ - void send_fragment (const RtecUDPAdmin::UDP_Addr& udp_addr, - CORBA::ULong request_id, - CORBA::ULong request_size, - CORBA::ULong fragment_size, - CORBA::ULong fragment_offset, - CORBA::ULong fragment_id, - CORBA::ULong fragment_count, - iovec iov[], - int iovcnt - TAO_ENV_ARG_DECL_WITH_DEFAULTS); - - /** - * Count the number of fragments that will be required to send the - * message blocks in the range [begin,end) - * The maximum fragment payload (i.e. the size without the header is - * also required); <total_length> returns the total message size. - */ - CORBA::ULong compute_fragment_count (const ACE_Message_Block* begin, - const ACE_Message_Block* end, - int iov_size, - CORBA::ULong max_fragment_payload, - CORBA::ULong& total_length); - -private: - /// The remote and the local EC, so we can reconnect when the - /// subscription list changes. - RtecEventChannelAdmin::EventChannel_var lcl_ec_; - - /// We talk to the EC (as a consumer) using this proxy. - RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_; - - /// We query this object to determine where are the events sent. - RtecUDPAdmin::AddrServer_var addr_server_; - - /// The datagram used to sendto(), this object is *not* owned by the - /// UDP_Sender. - TAO_ECG_UDP_Out_Endpoint *endpoint_; - - /// The MTU for this sender... - CORBA::ULong mtu_; -}; - // **************************************************************** /** |