diff options
Diffstat (limited to 'protocols/ace/RMCast')
28 files changed, 0 insertions, 4343 deletions
diff --git a/protocols/ace/RMCast/ACE_RMCast.pc.in b/protocols/ace/RMCast/ACE_RMCast.pc.in deleted file mode 100644 index 3eb6428d28b..00000000000 --- a/protocols/ace/RMCast/ACE_RMCast.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: ACE_RMCast -Description: ACE Reliable Multicast Library -Requires: ACE -Version: @VERSION@ -Libs: -L${libdir} -lACE_RMCast -Cflags: -I${includedir} diff --git a/protocols/ace/RMCast/Acknowledge.cpp b/protocols/ace/RMCast/Acknowledge.cpp deleted file mode 100644 index b647a255dad..00000000000 --- a/protocols/ace/RMCast/Acknowledge.cpp +++ /dev/null @@ -1,389 +0,0 @@ -// file : ace/RMCast/Acknowledge.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#include "ace/Time_Value.h" // ACE_Time_Value -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_stdlib.h" // abort -#include "ace/OS_NS_sys_time.h" // gettimeofday - -#include "Acknowledge.h" - -/* -#include <iostream> -using std::cerr; -using std::endl; -*/ - -namespace ACE_RMCast -{ - Acknowledge:: - Acknowledge (Parameters const& params) - : params_ (params), - hold_ (params.addr_map_size ()), - cond_ (mutex_), - nrtm_timer_ (params_.nrtm_timeout ()), - stop_ (false) - { - } - - void Acknowledge:: - in_start (In_Element* in) - { - Element::in_start (in); - } - - void Acknowledge:: - out_start (Out_Element* out) - { - Element::out_start (out); - - tracker_mgr_.spawn (track_thunk, this); - } - - void Acknowledge:: - out_stop () - { - { - Lock l (mutex_); - stop_ = true; - cond_.signal (); - } - - tracker_mgr_.wait (); - - Element::out_stop (); - } - - void Acknowledge:: - collapse (Queue& q) - { - // I would normally use iterators in the logic below but ACE_Map_Manager - // iterates over entries in no particular order so it is pretty much - // unusable here. Instead we will do slow and cumbersome find's. - // - - u64 sn (q.sn () + 1); - - for (;; ++sn) - { - Queue::ENTRY* e; - - if (q.find (sn, e) == -1 || e->int_id_.lost ()) break; - - Message_ptr m (e->int_id_.msg ()); - q.unbind (sn); - - in_->recv (m); - } - - q.sn (sn - 1); - } - - void Acknowledge:: - track () - { - while (true) - { - Messages msgs; - - { - Lock l (mutex_); - - if (stop_) - break; - - if (hold_.current_size () != 0) - { - for (Map::iterator i (hold_.begin ()), e (hold_.end ()); - i != e; - ++i) - { - Queue& q = (*i).int_id_; - - if (q.current_size () == 0) continue; - - track_queue ((*i).ext_id_, q, msgs); - } - } - - if (--nrtm_timer_ == 0) - { - nrtm_timer_ = params_.nrtm_timeout (); - - // Send NRTM. - // - unsigned short max_payload_size ( - params_.max_packet_size () - max_service_size); - - u32 max_elem (NRTM::max_count (max_payload_size)); - - Profile_ptr nrtm (create_nrtm (max_elem)); - - if (nrtm.get ()) - { - Message_ptr m (new Message); - m->add (nrtm); - msgs.push_back (m); - - } - } - } - - // Send stuff off. - // - for (Messages::Iterator i (msgs); !i.done (); i.advance ()) - { - Message_ptr* ppm; - i.next (ppm); - send (*ppm); - } - - // Go to sleep but watch for "manual cancellation" request. - // - { - ACE_Time_Value time (ACE_OS::gettimeofday ()); - time += params_.tick (); - - Lock l (mutex_); - - while (!stop_) - { - if (cond_.wait (&time) == -1) - { - if (errno != ETIME) - ACE_OS::abort (); - else - break; - } - } - - if (stop_) - break; - } - } - } - - void Acknowledge:: - track_queue (Address const& addr, Queue& q, Messages& msgs) - { - unsigned short max_payload_size ( - params_.max_packet_size () - max_service_size); - - u32 max_elem (NAK::max_count (max_payload_size)); - u32 count (0); - - Queue::iterator i (q.begin ()), e (q.end ()); - - // Track existing losses. - // - while (i != e) - { - NAK_ptr nak (new NAK (addr)); - - // Inner loop that fills NAK profile with up to max_elem elements. - // - for (; i != e && nak->count () < max_elem; ++i) - { - u64 sn ((*i).ext_id_); - Descr& d = (*i).int_id_; - - if (d.lost ()) - { - d.timer (d.timer () - 1); - - if (d.timer () == 0) - { - //@@ Need exp fallback. - // - d.nak_count (d.nak_count () + 1); - d.timer ((d.nak_count () + 1) * params_.nak_timeout ()); - - nak->add (sn); - - ++count; - - // cerr << 6 << "NAK # " << d.nak_count () << ": " - // << addr << " " << sn << endl; - } - } - } - - // Send this NAK. - // - if (nak->count ()) - { - // cerr << 5 << "NAK: " << addr << " " << nak->count () << " sns" - // << endl; - - Message_ptr m (new Message); - - m->add (Profile_ptr (nak.release ())); - - msgs.push_back (m); - } - } - - // Detect and record new losses. - // - for (u64 sn (q.sn () + 1), end (q.max_sn ()); sn < end; ++sn) - { - if (q.find (sn) == -1) - { - q.bind (sn, Descr (1)); - } - } - } - - void Acknowledge:: - recv (Message_ptr m) - { - // Handle NRTM. There could be some nasty interaction with code - // that handles data below (like missing message and NAK). This - // is why I hold the lock at the beginning (which may be not very - // efficient). - // - Lock l (mutex_); - - if (NRTM const* nrtm = static_cast<NRTM const*> (m->find (NRTM::id))) - { - for (Map::iterator i (hold_.begin ()), e (hold_.end ()); i != e; ++i) - { - u64 sn (nrtm->find ((*i).ext_id_)); - - if (sn != 0) - { - Queue& q = (*i).int_id_; - - u64 old (q.max_sn ()); - - if (old < sn) - { - // Mark as lost. - // - q.bind (sn, Descr (1)); - } - } - } - } - - if (m->find (Data::id) || m->find (NoData::id)) - { - Address from ( - static_cast<From const*> (m->find (From::id))->address ()); - - u64 sn (static_cast<SN const*> (m->find (SN::id))->num ()); - - Map::ENTRY* e; - - if (hold_.find (from, e) == -1) - { - // First message from this source. - // - hold_.bind (from, Queue (sn)); - in_->recv (m); - } - else - { - Queue& q = e->int_id_; - - if (sn <= q.sn ()) - { - // Duplicate. - // - //cerr << 6 << "DUP " << from << " " << q.sn () << " >= " << sn - // << endl; - } - else if (sn == q.sn () + 1) - { - // Next message. - // - - q.rebind (sn, Descr (m)); - collapse (q); - } - else - { - // Some messages are missing. Insert this one into the queue. - // - q.rebind (sn, Descr (m)); - } - } - } - else - { - l.release (); - - // Just forward it up. - // - in_->recv (m); - } - } - - void Acknowledge:: - send (Message_ptr m) - { - if (Data const* data = static_cast<Data const*> (m->find (Data::id))) - { - size_t max_payload_size ( - params_.max_packet_size () - max_service_size); - - if (max_payload_size > data->size ()) - { - u32 max_size (max_payload_size - data->size ()); - u32 max_elem (NRTM::max_count (max_size)); - - if (max_elem > 0) - { - Lock l (mutex_); - - Profile_ptr nrtm (create_nrtm (max_elem)); - - if (nrtm.get ()) - m->add (nrtm); - } - } - - nrtm_timer_ = params_.nrtm_timeout (); // Reset timer. - } - - out_->send (m); - } - - Profile_ptr Acknowledge:: - create_nrtm (u32 max_elem) - { - // Prepare NRTM. - // - NRTM_ptr nrtm (new NRTM ()); - - // Gather the information. - // - { - for (Map::iterator i (hold_.begin ()), e (hold_.end ()); i != e; ++i) - { - Address addr ((*i).ext_id_); - Queue& q = (*i).int_id_; - - //@@ Should look for the highest known number. - // - nrtm->insert (addr, q.sn ()); - - if (--max_elem == 0) - break; - } - } - - if (nrtm->empty ()) - return Profile_ptr (0); - else - return Profile_ptr (nrtm.release ()); - } - - ACE_THR_FUNC_RETURN Acknowledge:: - track_thunk (void* obj) - { - reinterpret_cast<Acknowledge*> (obj)->track (); - return 0; - } -} diff --git a/protocols/ace/RMCast/Acknowledge.h b/protocols/ace/RMCast/Acknowledge.h deleted file mode 100644 index 3d7654b1fec..00000000000 --- a/protocols/ace/RMCast/Acknowledge.h +++ /dev/null @@ -1,248 +0,0 @@ -// file : ace/RMCast/Acknowledge.h -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#ifndef ACE_RMCAST_ACKNOWLEDGE_H -#define ACE_RMCAST_ACKNOWLEDGE_H - -#include "ace/Hash_Map_Manager.h" -#include "ace/Thread_Manager.h" - -#include "Stack.h" -#include "Protocol.h" -#include "Bits.h" -#include "Parameters.h" - -#if !defined (ACE_RMCAST_DEFAULT_MAP_SIZE) -#define ACE_RMCAST_DEFAULT_MAP_SIZE 10 -#endif /* ACE_RMCAST_DEFAULT_MAP_SIZE */ - -#if !defined (ACE_RMCAST_DEFAULT_QUEUE_SIZE) -#define ACE_RMCAST_DEFAULT_QUEUE_SIZE 10 -#endif /* ACE_RMCAST_DEFAULT_QUEUE_SIZE */ - -namespace ACE_RMCast -{ - class Acknowledge : public Element - { - public: - Acknowledge (Parameters const& params); - - virtual void - in_start (In_Element* in); - - virtual void - out_start (Out_Element* out); - - virtual void - out_stop (); - - public: - virtual void - recv (Message_ptr m); - - virtual void - send (Message_ptr m); - - // Sun C++ 5.4 can't handle private here. - // - // private: - public: - struct Descr - { - //@@ There should be no default c-tor. - // - Descr () - : nak_count_ (0), timer_ (1) - { - } - - Descr (unsigned long timer) - : nak_count_ (0), timer_ (timer) - { - } - - Descr (Message_ptr m) - : m_ (m) - { - } - - public: - bool - lost () const - { - return m_.get () == 0; - } - - public: - Message_ptr - msg () - { - return m_; - } - - void - msg (Message_ptr m) - { - m_ = m; - } - - public: - unsigned long - nak_count () const - { - return nak_count_; - } - - void - nak_count (unsigned long v) - { - nak_count_ = v; - } - - unsigned long - timer () const - { - return timer_; - } - - void - timer (unsigned long v) - { - timer_ = v; - } - - private: - Message_ptr m_; - - unsigned long nak_count_; - unsigned long timer_; - }; - - private: - struct Queue : ACE_Hash_Map_Manager<u64, Descr, ACE_Null_Mutex> - { - typedef ACE_Hash_Map_Manager<u64, Descr, ACE_Null_Mutex> Base; - - // Should never be here but required by ACE_Hash_Blah_Blah. - // - Queue () - : Base (ACE_RMCAST_DEFAULT_MAP_SIZE), sn_ (0), max_sn_ (0) - { - } - - Queue (u64 sn) - : Base (ACE_RMCAST_DEFAULT_MAP_SIZE), sn_ (sn), max_sn_ (sn) - { - } - - Queue (Queue const& q) - : Base (ACE_RMCAST_DEFAULT_MAP_SIZE), sn_ (q.sn_), max_sn_ (sn_) - { - for (Queue::const_iterator i (q), e (q, 1); i != e; ++i) - { - bind ((*i).ext_id_, (*i).int_id_); - } - } - - public: - int - bind (u64 sn, Descr const& d) - { - int r (Base::bind (sn, d)); - - if (r == 0 && sn > max_sn_) max_sn_ = sn; - - return r; - } - - int - rebind (u64 sn, Descr const& d) - { - int r (Base::rebind (sn, d)); - - if (r == 0 && sn > max_sn_) max_sn_ = sn; - - return r; - } - - int - unbind (u64 sn) - { - int r (Base::unbind (sn)); - - if (r == 0 && sn == max_sn_) - { - for (--max_sn_; max_sn_ >= sn_; --max_sn_) - { - if (find (max_sn_) == 0) break; - } - } - - return r; - } - - public: - u64 - sn () const - { - return sn_; - } - - void - sn (u64 sn) - { - sn_ = sn; - } - - u64 - max_sn () const - { - if (current_size () == 0) return sn_; - - return max_sn_; - } - - private: - u64 sn_, max_sn_; - }; - - typedef - ACE_Hash_Map_Manager_Ex<Address, - Queue, - AddressHasher, - ACE_Equal_To<Address>, - ACE_Null_Mutex> - Map; - - private: - void - collapse (Queue& q); - - void - track (); - - void - track_queue (Address const& addr, Queue& q, Messages& msgs); - - Profile_ptr - create_nrtm (u32 max_elem); - - static ACE_THR_FUNC_RETURN - track_thunk (void* obj); - - private: - Parameters const& params_; - - Map hold_; - Mutex mutex_; - Condition cond_; - - unsigned long nrtm_timer_; - - bool stop_; - ACE_Thread_Manager tracker_mgr_; - }; -} - -#endif // ACE_RMCAST_ACKNOWLEDGE_H diff --git a/protocols/ace/RMCast/Bits.h b/protocols/ace/RMCast/Bits.h deleted file mode 100644 index 1b45580647b..00000000000 --- a/protocols/ace/RMCast/Bits.h +++ /dev/null @@ -1,26 +0,0 @@ -// file : ace/RMCast/Bits.h -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#ifndef ACE_RMCAST_BITS_H -#define ACE_RMCAST_BITS_H - -#include "ace/Auto_Ptr.h" -#include "ace/Thread_Mutex.h" -#include "ace/Condition_T.h" -#include "ace/Synch_Traits.h" - -namespace ACE_RMCast -{ - typedef ACE_SYNCH_MUTEX Mutex; - typedef ACE_Guard<Mutex> Lock; - typedef ACE_Condition<Mutex> Condition; - - // tmp - // - //using std::cerr; - //using std::endl; -} - - -#endif // ACE_RMCAST_BITS_H diff --git a/protocols/ace/RMCast/Flow.cpp b/protocols/ace/RMCast/Flow.cpp deleted file mode 100644 index a415862647e..00000000000 --- a/protocols/ace/RMCast/Flow.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// file : ace/RMCast/Flow.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#include "Flow.h" - -#include "ace/OS_NS_unistd.h" // sleep -#include "ace/OS_NS_sys_time.h" // gettimeofday - -#include "ace/os_include/os_math.h" // exp - -/* -#include <iostream> -using std::cerr; -using std::endl; -*/ - -namespace ACE_RMCast -{ - Flow:: - Flow (Parameters const& params) - : params_ (params), - nak_time_ (0, 0), - sample_start_time_ (0, 0), - sample_bytes_ (0), - current_tput_ (0.0), - cap_tput_ (0.0) - { - } - - void Flow:: - send (Message_ptr m) - { - if (Data const* data = static_cast<Data const*> (m->find (Data::id))) - { - ACE_Time_Value now_time (ACE_OS::gettimeofday ()); - - Lock l (mutex_); - sample_bytes_ += data->size (); - - if (sample_start_time_ == ACE_Time_Value (0, 0)) - { - sample_start_time_ = now_time; - } - else - { - ACE_Time_Value delta (now_time - sample_start_time_); - - if (delta > ACE_Time_Value (0, 2000)) - { - current_tput_ = - double (sample_bytes_) / (delta.sec () * 1000000 + delta.usec ()); - - // cerr << "tput: " << current_tput_ << " bytes/usec" << endl; - - sample_bytes_ = 0; - sample_start_time_ = ACE_Time_Value (0, 0); - } - } - - if (cap_tput_ != 0.0 - && current_tput_ != 0.0 - && current_tput_ > cap_tput_) - { - double dev = (current_tput_ - cap_tput_) / current_tput_; - - // cerr << "deviation: " << dev << endl; - - // Cap decay algorithm. - // - { - ACE_Time_Value delta (now_time - nak_time_); - - unsigned long msec = delta.msec (); - - double x = msec / -16000.0; - double y = 1.0 * exp (x); - cap_tput_ = cap_tput_ / y; - - // cerr << "cap decay: " << cap_tput_ << " bytes/usec" << endl; - } - - l.release (); - - - timespec time; - time.tv_sec = 0; - time.tv_nsec = static_cast<unsigned long> (dev * 500000.0); - - // Don't bother to sleep if the time is less than 10 usec. - // - if (time.tv_nsec > 10000) - ACE_OS::sleep (ACE_Time_Value (time)); - } - } - - out_->send (m); - } - - void Flow:: - recv (Message_ptr m) - { - if (NAK const* nak = static_cast<NAK const*> (m->find (NAK::id))) - { - Address to (static_cast<To const*> (m->find (To::id))->address ()); - - if (nak->address () == to) - { - // This one is for us. - // - - //cerr << "NAK from " - // << static_cast<From const*> (m->find (From::id))->address () - // << " for " << nak->count () << " sns." << endl; - - - ACE_Time_Value nak_time (ACE_OS::gettimeofday ()); - - Lock l (mutex_); - - nak_time_ = nak_time; - - if (cap_tput_ == 0.0) - cap_tput_ = current_tput_; - - if (cap_tput_ != 0.0) - { - cap_tput_ = cap_tput_ - cap_tput_ / 6.0; - - // cerr << "cap: " << cap_tput_ << " bytes/usec" << endl; - } - } - } - - in_->recv (m); - } -} - diff --git a/protocols/ace/RMCast/Flow.h b/protocols/ace/RMCast/Flow.h deleted file mode 100644 index e64d0d438a2..00000000000 --- a/protocols/ace/RMCast/Flow.h +++ /dev/null @@ -1,43 +0,0 @@ -// file : ace/RMCast/Flow.h -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#ifndef ACE_RMCAST_FLOW_H -#define ACE_RMCAST_FLOW_H - -#include "Stack.h" -#include "Protocol.h" -#include "Bits.h" -#include "Parameters.h" - -namespace ACE_RMCast -{ - class Flow : public Element - { - public: - Flow (Parameters const& params); - - public: - virtual void - send (Message_ptr m); - - virtual void - recv (Message_ptr m); - - private: - Parameters const& params_; - - Mutex mutex_; - ACE_Time_Value nak_time_; - - // Throughput sampling. - // - ACE_Time_Value sample_start_time_; - unsigned long sample_bytes_; - double current_tput_; - double cap_tput_; - }; -} - - -#endif // ACE_RMCAST_FLOW_H diff --git a/protocols/ace/RMCast/Fragment.cpp b/protocols/ace/RMCast/Fragment.cpp deleted file mode 100644 index 27247f0e3f9..00000000000 --- a/protocols/ace/RMCast/Fragment.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// file : ace/RMCast/Fragment.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#include "Fragment.h" - -/* -#include <iostream> -using std::cerr; -using std::endl; -*/ - -namespace ACE_RMCast -{ - Fragment:: - Fragment (Parameters const& params) - : params_ (params), - sn_ (1) - { - } - - void Fragment:: - send (Message_ptr m) - { - if (Data const* data = static_cast<Data const*> (m->find (Data::id))) - { - size_t max_payload_size ( - params_.max_packet_size () - max_service_size); - - if (data->size () <= max_payload_size) - { - u64 sn; - { - Lock l (mutex_); - sn = sn_++; - } - - m->add (Profile_ptr (new SN (sn))); - - out_->send (m); - return; - } - - char const* p = data->buf (); - size_t size (data->size ()); - - // Need fragmentation. - // - u32 packets (size / max_payload_size + (size % max_payload_size ? 1 : 0)); - - // cerr << "size : " << size << endl - // << "packs: " << packets << endl; - - for (u32 i (1); i <= packets; ++i) - { - Message_ptr part (new Message); - - size_t s (i == packets ? size % max_payload_size : max_payload_size); - - // cerr << "pack: " << s << endl; - - u64 sn; - { - Lock l (mutex_); - sn = sn_++; - } - - part->add (Profile_ptr (new SN (sn))); - part->add (Profile_ptr (new Part (i, packets, size))); - part->add (Profile_ptr (new Data (p, s))); - - out_->send (part); - - p += s; - } - } - } -} diff --git a/protocols/ace/RMCast/Fragment.h b/protocols/ace/RMCast/Fragment.h deleted file mode 100644 index bfaa3044c83..00000000000 --- a/protocols/ace/RMCast/Fragment.h +++ /dev/null @@ -1,32 +0,0 @@ -// file : ace/RMCast/Fragment.h -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#ifndef ACE_RMCAST_FRAGMENT_H -#define ACE_RMCAST_FRAGMENT_H - -#include "Stack.h" -#include "Protocol.h" -#include "Bits.h" -#include "Parameters.h" - -namespace ACE_RMCast -{ - class Fragment : public Element - { - public: - Fragment (Parameters const& params); - - public: - virtual void - send (Message_ptr m); - - Parameters const& params_; - - private: - Mutex mutex_; - u64 sn_; - }; -} - -#endif // ACE_RMCAST_FRAGMENT_H diff --git a/protocols/ace/RMCast/Link.cpp b/protocols/ace/RMCast/Link.cpp deleted file mode 100644 index e3379ac1893..00000000000 --- a/protocols/ace/RMCast/Link.cpp +++ /dev/null @@ -1,332 +0,0 @@ -// file : ace/RMCast/Link.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#include "ace/Time_Value.h" // ACE_Time_Value -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_stdlib.h" -#include "ace/OS_NS_sys_socket.h" - -#include "Link.h" - -namespace ACE_RMCast -{ - Link:: - Link (Address const& addr, Parameters const& params) - : params_ (params), - addr_ (addr), - ssock_ (Address (static_cast<unsigned short> (0), - static_cast<ACE_UINT32> (INADDR_ANY)), - AF_INET, - IPPROTO_UDP, - 1), - stop_ (false) - - { - srand (time (0)); - - - rsock_.set_option (IP_MULTICAST_LOOP, 0); - // rsock_.set_option (IP_MULTICAST_TTL, 0); - - // Set recv/send buffers. - // - { - int r (131070); - int s (sizeof (r)); - - static_cast<ACE_SOCK&> (rsock_).set_option ( - SOL_SOCKET, SO_RCVBUF, &r, s); - - static_cast<ACE_SOCK&> (ssock_).set_option ( - SOL_SOCKET, SO_RCVBUF, &r, s); - - rsock_.get_option (SOL_SOCKET, SO_RCVBUF, &r, &s); - //cerr << 5 << "recv buffer size: " << r << endl; - - ssock_.get_option (SOL_SOCKET, SO_RCVBUF, &r, &s); - //cerr << 5 << "send buffer size: " << r << endl; - - } - - // Bind address and port. - // - if (ACE_OS::connect (ssock_.get_handle (), - reinterpret_cast<sockaddr*> (addr_.get_addr ()), - addr_.get_addr_size ()) == -1) - { - ACE_OS::perror ("connect: "); - ACE_OS::abort (); - } - - - ssock_.get_local_addr (self_); - - //cerr << 5 << "self: " << self_ << endl; - } - - void Link:: - in_start (In_Element* in) - { - Element::in_start (in); - - rsock_.join (addr_); - - // Start receiving thread. - // - recv_mgr_.spawn (recv_thunk, this); - } - - void Link:: - out_start (Out_Element* out) - { - Element::out_start (out); - } - - void Link:: - in_stop () - { - // Stop receiving thread. - // - { - Lock l (mutex_); - stop_ = true; - } - recv_mgr_.wait (); - - Element::in_stop (); - } - - void Link:: - send (Message_ptr m) - { - // Simulate message loss and reordering. - // - if (params_.simulator ()) - { - if ((rand () % 17) != 0) - { - Lock l (mutex_); - - if (hold_.get ()) - { - send_ (m); - send_ (hold_); - hold_ = Message_ptr (0); - } - else - { - if ((rand () % 17) != 0) - { - send_ (m); - } - else - { - hold_ = m; - - // Make a copy in M so that the reliable loop below - // won't add FROM and TO to HOLD_. - // - m = hold_->clone (); - } - } - } - } - else - send_ (m); - - // Reliable loop. - // - m->add (Profile_ptr (new From (self_))); - m->add (Profile_ptr (new To (self_))); - - in_->recv (m); - } - - void Link:: - send_ (Message_ptr m) - { - ostream os (m->size (), 1); // Always little-endian. - - os << *m; - - if (os.length () > size_t (params_.max_packet_size ())) - { - ACE_ERROR ((LM_ERROR, - "packet length (%d) exceeds max_poacket_size (%d)\n", - os.length (), params_.max_packet_size ())); - - for (Message::ProfileIterator i (m->begin ()); !i.done (); i.advance ()) - { - ACE_ERROR ((LM_ERROR, - "profile id: %d; size: %d\n", - (*i).ext_id_, (*i).int_id_->size ())); - } - - ACE_OS::abort (); - } - - ssock_.send (os.buffer (), os.length (), addr_); - - /* - if (m->find (nrtm::id)) - { - write (1, os.buffer (), os.length ()); - exit (1); - } - */ - } - - void Link:: - recv () - { - size_t max_packet_size (params_.max_packet_size ()); - - // This is wicked. - // - ACE_Auto_Ptr<char> holder ( - reinterpret_cast<char*> ( - operator new (max_packet_size + ACE_CDR::MAX_ALIGNMENT))); - - char* data = ACE_ptr_align_binary (holder.get (), ACE_CDR::MAX_ALIGNMENT); - - size_t size (0); - - while (true) - { - //@@ Should I lock here? - // - - Address addr; - - // Block for up to one tick waiting for an incomming message. - // - for (;;) - { - ACE_Time_Value t (params_.tick ()); - ssize_t r = rsock_.recv (data, 4, addr, MSG_PEEK, &t); - - - // Check for cancellation request. - // - { - Lock l (mutex_); - if (stop_) - return; - } - - if (r == -1) - { - if (errno != ETIME) - ACE_OS::abort (); - } - else - { - size = static_cast<size_t> (r); - break; - } - } - - - if (size != 4 || addr == self_) - { - // Discard bad messages and ones from ourselvs since - // we are using reliable loopback. - // - rsock_.recv (data, 0, addr); - continue; - } - - u32 msg_size; - { - istream is (data, size, 1); // Always little-endian. - is >> msg_size; - } - - if (msg_size <= 4 || msg_size > max_packet_size) - { - // Bad message. - // - rsock_.recv (data, 0, addr); - continue; - } - - size = rsock_.recv (data, max_packet_size, addr); - - if (msg_size != size) - { - // Bad message. - // - continue; - } - - //cerr << 6 << "from: " << addr << endl; - - Message_ptr m (new Message ()); - - m->add (Profile_ptr (new From (addr))); - m->add (Profile_ptr (new To (self_))); - - istream is (data, size, 1); // Always little-endian. - - is >> msg_size; - - while (true) - { - u16 id, size; - - if (!((is >> id) && (is >> size))) break; - - //cerr << 6 << "reading profile with id " << id << " " - // << size << " bytes long" << endl; - - Profile::Header hdr (id, size); - - if (id == SN::id) - { - m->add (Profile_ptr (new SN (hdr, is))); - } - else if (id == Data::id) - { - m->add (Profile_ptr (new Data (hdr, is))); - } - else if (id == NAK::id) - { - m->add (Profile_ptr (new NAK (hdr, is))); - } - else if (id == NRTM::id) - { - m->add (Profile_ptr (new NRTM (hdr, is))); - } - else if (id == NoData::id) - { - m->add (Profile_ptr (new NoData (hdr, is))); - } - else if (id == Part::id) - { - m->add (Profile_ptr (new Part (hdr, is))); - } - else - { - //cerr << 0 << "unknown profile id " << hdr.id () << endl; - ACE_OS::abort (); - } - } - - in_->recv (m); - } - } - - ACE_THR_FUNC_RETURN Link:: - recv_thunk (void* obj) - { - reinterpret_cast<Link*> (obj)->recv (); - return 0; - } - - void Link:: - recv (Message_ptr) - { - ACE_OS::abort (); - } -} diff --git a/protocols/ace/RMCast/Link.h b/protocols/ace/RMCast/Link.h deleted file mode 100644 index cff166c6e13..00000000000 --- a/protocols/ace/RMCast/Link.h +++ /dev/null @@ -1,71 +0,0 @@ -// file : ace/RMCast/Link.h -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#ifndef ACE_RMCAST_LINK_H -#define ACE_RMCAST_LINK_H - -#include "ace/SOCK_Dgram.h" -#include "ace/SOCK_Dgram_Mcast.h" - -#include "ace/Thread_Manager.h" - -#include "Stack.h" -#include "Protocol.h" -#include "Parameters.h" - -namespace ACE_RMCast -{ - class Link : public Element - { - public: - Link (Address const& addr, Parameters const& params); - - virtual void - in_start (In_Element* in); - - virtual void - out_start (Out_Element* out); - - virtual void - in_stop (); - - public: - virtual void - send (Message_ptr m); - - private: - virtual void - send_ (Message_ptr m); - - private: - void - recv (); - - static ACE_THR_FUNC_RETURN - recv_thunk (void* obj); - - private: - virtual void - recv (Message_ptr); - - private: - Parameters const& params_; - - Address addr_, self_; - ACE_SOCK_Dgram_Mcast rsock_; - ACE_SOCK_Dgram ssock_; - - bool stop_; - ACE_Thread_Manager recv_mgr_; - - // Simulator. - // - Message_ptr hold_; - - Mutex mutex_; - }; -} - - -#endif // ACE_RMCAST_LINK_H diff --git a/protocols/ace/RMCast/Makefile.am b/protocols/ace/RMCast/Makefile.am deleted file mode 100644 index 1a121915c62..00000000000 --- a/protocols/ace/RMCast/Makefile.am +++ /dev/null @@ -1,79 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## ./bin/mwc.pl -include /home/jtc/ACE/ACE-config3/MPC/config -include /home/jtc/ACE/ACE-config3/MPC/templates -type automake ACE.mwc - -includedir = @includedir@/ace/RMCast -pkgconfigdir = @libdir@/pkgconfig - -ACE_BUILDDIR = $(top_builddir) -ACE_ROOT = $(top_srcdir) - - - -if BUILD_THREADS - -lib_LTLIBRARIES = libACE_RMCast.la - -libACE_RMCast_la_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -DACE_RMCAST_BUILD_DLL - -libACE_RMCast_la_SOURCES = \ - Acknowledge.cpp \ - Flow.cpp \ - Fragment.cpp \ - Link.cpp \ - Protocol.cpp \ - Reassemble.cpp \ - Retransmit.cpp \ - Simulator.cpp \ - Socket.cpp \ - Stack.cpp \ - Template_Instantiations.cpp - -libACE_RMCast_la_LDFLAGS = \ - -version-number @ACE_MAJOR@:@ACE_MINOR@:@ACE_BETA@ - -libACE_RMCast_la_LIBADD = \ - $(ACE_BUILDDIR)/ace/libACE.la - -nobase_include_HEADERS = \ - Acknowledge.h \ - Bits.h \ - Flow.h \ - Fragment.h \ - Link.h \ - Parameters.h \ - Protocol.h \ - RMCast_Export.h \ - Reassemble.h \ - Retransmit.h \ - Simulator.h \ - Socket.h \ - Stack.h - -pkgconfig_DATA = ACE_RMCast.pc - -ACE_RMCast.pc: ${top_builddir}/config.status ${srcdir}/ACE_RMCast.pc.in - ${top_builddir}/config.status --file $@:${srcdir}/ACE_RMCast.pc.in - -endif BUILD_THREADS - -EXTRA_DIST = \ - ACE_RMCast.pc.in - - -## Clean up template repositories, etc. -clean-local: - -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* - -rm -f gcctemp.c gcctemp so_locations *.ics - -rm -rf cxx_repository ptrepository ti_files - -rm -rf templateregistry ir.out - -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/protocols/ace/RMCast/Parameters.h b/protocols/ace/RMCast/Parameters.h deleted file mode 100644 index d254bd00fad..00000000000 --- a/protocols/ace/RMCast/Parameters.h +++ /dev/null @@ -1,109 +0,0 @@ -// file : ace/RMCast/Parameters.h -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#ifndef ACE_RMCAST_PARAMETERS_H -#define ACE_RMCAST_PARAMETERS_H - -#include "ace/Time_Value.h" - - -namespace ACE_RMCast -{ - class Parameters - { - public: - Parameters ( - // Loss and reordering simulator. - // - bool simulator = false, - - // MTU(1500) - IP-hdr - UDP-hdr - // - unsigned short max_packet_size = 1470, - - // How often various worker threads wakeup to do - // cacellation checks, queue run-throughs, etc. - // - ACE_Time_Value const& tick = ACE_Time_Value (0, 2000), - - // How long to wait, in ticks, before sending NAK. - // - unsigned long nak_timeout = 1, - - // How long to wait, in ticks, before sending NRTM. - // - unsigned long nrtm_timeout = 10, - - // How long to retain a message for retransmission, in ticks. - // - unsigned long retention_timeout = 500, // 1 sec - - size_t addr_map_size = 50 - ) - : simulator_ (simulator), - max_packet_size_ (max_packet_size), - tick_ (tick), - nak_timeout_ (nak_timeout), - nrtm_timeout_ (nrtm_timeout), - retention_timeout_ (retention_timeout), - addr_map_size_(addr_map_size) - { - } - - public: - bool - simulator () const - { - return simulator_; - } - - unsigned short - max_packet_size () const - { - return max_packet_size_; - } - - ACE_Time_Value const& - tick () const - { - return tick_; - } - - unsigned long - nak_timeout () const - { - return nak_timeout_; - } - - unsigned long - nrtm_timeout () const - { - return nrtm_timeout_; - } - - unsigned long - retention_timeout () const - { - return retention_timeout_; - } - - size_t - addr_map_size () const - { - return addr_map_size_; - } - - private: - bool simulator_; - unsigned short max_packet_size_; - ACE_Time_Value tick_; - unsigned long nak_timeout_; - unsigned long nrtm_timeout_; - unsigned long retention_timeout_; - size_t addr_map_size_; - }; -} - - -#endif // ACE_RMCAST_PARAMETERS_H diff --git a/protocols/ace/RMCast/Protocol.cpp b/protocols/ace/RMCast/Protocol.cpp deleted file mode 100644 index 755872371cb..00000000000 --- a/protocols/ace/RMCast/Protocol.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// file : ace/RMCast/Protocol.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#include "Protocol.h" - -namespace ACE_RMCast -{ - u16 const From:: id = 0x0001; - u16 const To:: id = 0x0002; - u16 const Data:: id = 0x0003; - u16 const SN:: id = 0x0004; - u16 const NAK:: id = 0x0005; - u16 const NRTM:: id = 0x0006; - u16 const NoData::id = 0x0007; - u16 const Part:: id = 0x0008; -} diff --git a/protocols/ace/RMCast/Protocol.h b/protocols/ace/RMCast/Protocol.h deleted file mode 100644 index c0e2797b732..00000000000 --- a/protocols/ace/RMCast/Protocol.h +++ /dev/null @@ -1,1274 +0,0 @@ -// file : ace/RMCast/Protocol.h -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#ifndef ACE_RMCAST_PROTOCOL_H -#define ACE_RMCAST_PROTOCOL_H - -#include "ace/Refcounted_Auto_Ptr.h" - -#include "ace/Vector_T.h" -#include "ace/Hash_Map_Manager.h" - -#include "ace/CDR_Stream.h" -#include "ace/CDR_Size.h" - -#include "ace/INET_Addr.h" -#include "ace/Null_Mutex.h" - -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_stdlib.h" - -#include "Bits.h" - -/* -#include <iostream> -*/ - -namespace ACE_RMCast -{ - // Basic types. - // - typedef ACE_CDR::UShort u16; - typedef ACE_CDR::ULong u32; - typedef ACE_CDR::ULongLong u64; - - // Protocol parameters - // - // - unsigned short const max_service_size = 60; // service profiles (Part, SN, - // etc), sizes plus message size. - - // - // - // - typedef ACE_INET_Addr Address; - - struct AddressHasher - { - unsigned long - operator() (Address const& a) const - { - unsigned long port (a.get_port_number ()); - unsigned long ip (a.get_ip_address ()); - - port <<= sizeof (unsigned long) - sizeof (unsigned short); - - return port ^ ip; - } - }; - - //@@ Provide stream<< (Address const&) - // - - typedef ACE_OutputCDR ostream; - typedef ACE_SizeCDR sstream; - typedef ACE_InputCDR istream; - - struct Profile; - - typedef - ACE_Refcounted_Auto_Ptr<Profile, Mutex> - Profile_ptr; - - struct Profile - { - public: - class Header - { - public: - Header (u16 id, u16 size) - : id_ (id), size_ (size) - { - } - - Header (istream& is) - { - (void) (is >> id_ >> size_); - } - - public: - u16 - id () const - { - return id_; - } - - u16 - size () const - { - return size_; - } - - protected: - void - size (u16 s) - { - size_ = s; - } - - friend struct Profile; - - private: - u16 id_; - u16 size_; - }; - - public: - virtual - ~Profile () - { - } - - Profile_ptr - clone () - { - return clone_ (); - } - - protected: - Profile (u16 id) - : header_ (id, 0) - { - } - - Profile (Header const& h) - : header_ (h) - { - } - - virtual Profile_ptr - clone_ () = 0; - - private: - Profile& - operator= (Profile const&); - - public: - u16 - id () const - { - return header_.id (); - } - - u16 - size () const - { - return header_.size (); - } - - protected: - void - size (u16 s) - { - header_.size (s); - } - - u16 - calculate_size () - { - sstream ss; - - serialize_body (ss); - - return static_cast<u16> (ss.total_length ()); - } - - public: - virtual void - serialize_body (ostream&) const = 0; - - virtual void - serialize_body (sstream&) const = 0; - - friend - ostream& - operator<< (ostream& os, Profile const& p); - - friend - sstream& - operator<< (sstream& ss, Profile const& p); - - private: - Header header_; - }; - - inline - ostream& - operator<< (ostream& os, Profile::Header const& hdr) - { - os << hdr.id (); - os << hdr.size (); - - return os; - } - - inline - sstream& - operator<< (sstream& ss, Profile::Header const& hdr) - { - ss << hdr.id (); - ss << hdr.size (); - - return ss; - } - - inline - ostream& - operator<< (ostream& os, Profile const& p) - { - os << p.header_; - p.serialize_body (os); - - return os; - } - - inline - sstream& - operator<< (sstream& ss, Profile const& p) - { - ss << p.header_; - p.serialize_body (ss); - - return ss; - } - - - // - // - // - class Message; - - typedef - ACE_Refcounted_Auto_Ptr<Message, Mutex> - Message_ptr; - - class Message - { - typedef - ACE_Hash_Map_Manager<u16, Profile_ptr, ACE_Null_Mutex> - Profiles; - - public: - Message () - : profiles_ (4) - { - } - - Message_ptr - clone () - { - return new Message (*this); - } - - protected: - Message (Message const& m) - : profiles_ (4) - { - for (Profiles::const_iterator i (m.profiles_); !i.done (); i.advance ()) - { - // Shallow copy of profiles. This implies that profiles are not - // modified as they go up/down the stack. - // - profiles_.bind ((*i).ext_id_, (*i).int_id_); - } - } - - private: - Message& - operator= (Message const&); - - public: - bool - add (Profile_ptr p) - { - u16 id (p->id ()); - - if (profiles_.find (id) == 0) - { - return false; - } - - profiles_.bind (id, p); - - return true; - } - - void - replace (Profile_ptr p) - { - profiles_.rebind (p->id (), p); - } - - void - remove (u16 id) - { - profiles_.unbind (id); - } - - Profile const* - find (u16 id) const - { - Profiles::ENTRY* e = 0; - - if (profiles_.find (id, e) == -1) return 0; - - return e->int_id_.get (); - } - - typedef - Profiles::const_iterator - ProfileIterator; - - ProfileIterator - begin () const - { - return ProfileIterator (profiles_); - } - - public: - size_t - size () const - { - sstream ss; - - u32 s (0); - - ss << s; - - for (Profiles::const_iterator i (profiles_); !i.done (); i.advance ()) - { - ss << *((*i).int_id_); - } - - return ss.total_length (); - } - - friend - ostream& - operator<< (ostream& os, Message const& m) - { - u32 s (m.size ()); - - os << s; - - for (Profiles::const_iterator i (m.profiles_); !i.done (); i.advance ()) - { - os << *((*i).int_id_); - } - - return os; - } - - private: - Profiles profiles_; - }; - - typedef ACE_Vector<Message_ptr, ACE_VECTOR_DEFAULT_SIZE> Messages; - - // - // - // - struct From; - - typedef - ACE_Refcounted_Auto_Ptr<From, Mutex> - From_ptr; - - struct From : Profile - { - static u16 const id; - - public: - From (Header const& h, istream& is) - : Profile (h) - { - u32 addr; - u16 port; - - is >> addr; - is >> port; - - address_ = Address (port, addr); - } - - From (Address const& addr) - : Profile (id), address_ (addr) - { - size (calculate_size ()); - } - - From_ptr - clone () - { - return From_ptr (static_cast<From*> (clone_ ().release ())); - } - - protected: - virtual Profile_ptr - clone_ () - { - return new From (*this); - } - - From (From const& from) - : Profile (from), - address_ (from.address_) - { - } - - public: - Address const& - address () const - { - return address_; - } - - public: - virtual void - serialize_body (ostream& os) const - { - u32 addr (address_.get_ip_address ()); - u16 port (address_.get_port_number ()); - - os << addr; - os << port; - } - - virtual void - serialize_body (sstream& ss) const - { - u32 addr (0); - u16 port (0); - - ss << addr; - ss << port; - } - - private: - Address address_; - }; - - - // - // - // - struct To; - - typedef - ACE_Refcounted_Auto_Ptr<To, Mutex> - To_ptr; - - struct To : Profile - { - static u16 const id; - - public: - To (Header const& h, istream& is) - : Profile (h) - { - u32 addr; - u16 port; - - is >> addr; - is >> port; - - address_ = Address (port, addr); - } - - To (Address const& addr) - : Profile (id), address_ (addr) - { - size (calculate_size ()); - } - - To_ptr - clone () - { - return To_ptr (static_cast<To*> (clone_ ().release ())); - } - - protected: - virtual Profile_ptr - clone_ () - { - return new To (*this); - } - - To (To const& to) - : Profile (to), - address_ (to.address_) - { - } - - public: - Address const& - address () const - { - return address_; - } - - public: - virtual void - serialize_body (ostream& os) const - { - u32 addr (address_.get_ip_address ()); - u16 port (address_.get_port_number ()); - - os << addr; - os << port; - } - - virtual void - serialize_body (sstream& ss) const - { - u32 addr (0); - u16 port (0); - - ss << addr; - ss << port; - } - - private: - Address address_; - }; - - - // - // - // - struct Data; - - typedef - ACE_Refcounted_Auto_Ptr<Data, Mutex> - Data_ptr; - - struct Data : Profile - { - static u16 const id; - - public: - virtual - ~Data () - { - if (buf_) - operator delete (buf_); - } - - Data (Header const& h, istream& is) - : Profile (h), - buf_ (0), - size_ (h.size ()), - capacity_ (size_) - { - if (size_) - { - buf_ = reinterpret_cast<char*> (operator new (capacity_)); - is.read_char_array (buf_, size_); - } - } - - Data (void const* buf, size_t s, size_t capacity = 0) - : Profile (id), - buf_ (0), - size_ (s), - capacity_ (capacity < size_ ? size_ : capacity) - { - if (size_) - { - buf_ = reinterpret_cast<char*> (operator new (capacity_)); - ACE_OS::memcpy (buf_, buf, size_); - } - - Profile::size (calculate_size ()); - } - - Data_ptr - clone () - { - return Data_ptr (static_cast<Data*> (clone_ ().release ())); - } - - protected: - virtual Profile_ptr - clone_ () - { - return new Data (*this); - } - - Data (Data const& d) - : Profile (d), - buf_ (0), - size_ (d.size_), - capacity_ (d.capacity_) - { - if (size_) - { - buf_ = reinterpret_cast<char*> (operator new (capacity_)); - ACE_OS::memcpy (buf_, d.buf_, size_); - } - - Profile::size (calculate_size ()); - } - - public: - char const* - buf () const - { - return buf_; - } - - char* - buf () - { - return buf_; - } - - size_t - size () const - { - return size_; - } - - void - size (size_t s) - { - if (s > capacity_) - ACE_OS::abort (); - - size_ = s; - - Profile::size (calculate_size ()); - } - - size_t - capacity () const - { - return capacity_; - } - - public: - virtual void - serialize_body (ostream& os) const - { - os.write_char_array (buf_, size_); - } - - virtual void - serialize_body (sstream& ss) const - { - ss.write_char_array (buf_, size_); - } - - private: - char* buf_; - size_t size_; - size_t capacity_; - }; - - - // - // - // - struct SN; - - typedef - ACE_Refcounted_Auto_Ptr<SN, Mutex> - SN_ptr; - - struct SN : Profile - { - static u16 const id; - - public: - SN (Header const& h, istream& is) - : Profile (h) - { - is >> n_; - } - - SN (u64 n) - : Profile (id), n_ (n) - { - size (calculate_size ()); - } - - SN_ptr - clone () - { - return SN_ptr (static_cast<SN*> (clone_ ().release ())); - } - - protected: - virtual Profile_ptr - clone_ () - { - return new SN (*this); - } - - SN (SN const& sn) - : Profile (sn), - n_ (sn.n_) - { - } - - public: - u64 - num () const - { - return n_; - } - - public: - virtual void - serialize_body (ostream& os) const - { - os << n_; - } - - virtual void - serialize_body (sstream& ss) const - { - ss << n_; - } - - private: - u64 n_; - }; - - - // - // - // - class NAK; - - typedef - ACE_Refcounted_Auto_Ptr<NAK, Mutex> - NAK_ptr; - - class NAK : public Profile - { - public: - - static u16 const id; - - typedef ACE_Vector<u64, ACE_VECTOR_DEFAULT_SIZE> SerialNumbers; - typedef SerialNumbers::Iterator iterator; - - NAK (Header const& h, istream& is) - : Profile (h) - { - u64 sn (0); - u32 addr (0); - u16 port (0); - - sstream ss; - - ss << sn; - size_t sn_size (ss.total_length ()); - - ss.reset (); - - ss << addr; - ss << port; - - size_t addr_size (ss.total_length ()); - - - is >> addr; - is >> port; - - // num_of_sns = (size - addr_size) / sn_size - // - for (unsigned long i (0); i < ((h.size () - addr_size) / sn_size); ++i) - { - is >> sn; - sns_.push_back (sn); - } - - - address_ = Address (port, addr); - } - - NAK (Address const& src) - : Profile (id), address_ (src) - { - size (calculate_size ()); - } - - NAK_ptr - clone () - { - return NAK_ptr (static_cast<NAK*> (clone_ ().release ())); - } - - protected: - virtual Profile_ptr - clone_ () - { - return new NAK (*this); - } - - NAK (NAK const& nak) - : Profile (nak), - address_ (nak.address_), - sns_ (nak.sns_) - { - } - - public: - void - add (u64 sn) - { - sns_.push_back (sn); - size (calculate_size ()); - } - - public: - Address const& - address () const - { - return address_; - } - - - iterator - begin () /* const */ - { - return iterator (sns_); - } - - /* - iterator - end () const - { - return sns_.end (); - } - */ - - size_t - count () const - { - return sns_.size (); - } - - public: - // Count max number of elements that will fit into NAK profile - // with size <= max_size. - // - static u32 - max_count (u32 max_size) - { - u32 n (0); - - sstream ss; - - Profile::Header hdr (0, 0); - ss << hdr; - - u32 addr (0); - u16 port (0); - ss << addr; - ss << port; - - while (true) - { - u64 sn (0); - ss << sn; - - if (ss.total_length () <= max_size) - ++n; - - if (ss.total_length () >= max_size) - break; - } - - return n; - } - - public: - virtual void - serialize_body (ostream& os) const - { - NAK& this_ = const_cast<NAK&> (*this); // Don't put in ROM. - - u32 addr (address_.get_ip_address ()); - u16 port (address_.get_port_number ()); - - os << addr; - os << port; - - // Stone age iteration. - // - for (iterator i (this_.begin ()); !i.done (); i.advance ()) - { - u64* psn; - i.next (psn); - os << *psn; - } - } - - virtual void - serialize_body (sstream& ss) const - { - NAK& this_ = const_cast<NAK&> (*this); // Don't put in ROM. - - u32 addr (0); - u16 port (0); - - ss << addr; - ss << port; - - // Stone age iteration. - // - for (iterator i (this_.begin ()); !i.done (); i.advance ()) - { - u64 sn (0); - ss << sn; - } - } - - private: - Address address_; - SerialNumbers sns_; - }; - - // - // - // - struct NRTM; - - typedef - ACE_Refcounted_Auto_Ptr<NRTM, Mutex> - NRTM_ptr; - - struct NRTM : Profile - { - static u16 const id; - - public: - NRTM (Header const& h, istream& is) - : Profile (h), map_ (10) - { - u32 addr (0); - u16 port (0); - u64 sn (0); - - sstream ss; - - ss << sn; - ss << addr; - ss << port; - - size_t block_size (ss.total_length ()); - - - // num_of_blocks = size / block_size - // - for (size_t i (0); i < (h.size () / block_size); ++i) - { - is >> sn; - is >> addr; - is >> port; - - map_.bind (Address (port, addr), sn); - } - } - - NRTM () - : Profile (id), map_ (10) - { - size (calculate_size ()); - } - - NRTM_ptr - clone () - { - return NRTM_ptr (static_cast<NRTM*> (clone_ ().release ())); - } - - protected: - virtual Profile_ptr - clone_ () - { - return new NRTM (*this); - } - - NRTM (NRTM const& nrtm) - : Profile (nrtm) - { - for (Map::const_iterator i (nrtm.map_); !i.done (); i.advance ()) - { - map_.bind ((*i).ext_id_, (*i).int_id_); - } - } - - public: - void - insert (Address const& addr, u64 sn) - { - map_.bind (addr, sn); - - size (calculate_size ()); - } - - u64 - find (Address const& addr) const - { - u64 sn; - - if (map_.find (addr, sn) == -1) return 0; - - return sn; - } - - bool - empty () const - { - return map_.current_size () == 0; - } - - public: - // Count max number of elements that will fit into NRTM profile - // with size <= max_size. - // - static u32 - max_count (u32 max_size) - { - u32 n (0); - - sstream ss; - - Profile::Header hdr (0, 0); - ss << hdr; - - while (true) - { - u32 addr (0); - u16 port (0); - u64 sn (0); - - ss << sn; - ss << addr; - ss << port; - - if (ss.total_length () <= max_size) - ++n; - - if (ss.total_length () >= max_size) - break; - } - - return n; - } - - public: - virtual void - serialize_body (ostream& os) const - { - for (Map::const_iterator i (map_), e (map_, 1); i != e; ++i) - { - u32 addr ((*i).ext_id_.get_ip_address ()); - u16 port ((*i).ext_id_.get_port_number ()); - u64 sn ((*i).int_id_); - - os << sn; - os << addr; - os << port; - - } - } - - virtual void - serialize_body (sstream& ss) const - { - for (Map::const_iterator i (map_), e (map_, 1); i != e; ++i) - { - u32 addr (0); - u16 port (0); - u64 sn (0); - - ss << sn; - ss << addr; - ss << port; - } - } - - private: - typedef - ACE_Hash_Map_Manager_Ex<Address, - u64, - AddressHasher, - ACE_Equal_To<Address>, - ACE_Null_Mutex> - Map; - - Map map_; - }; - - - // - // - // - struct NoData; - - typedef - ACE_Refcounted_Auto_Ptr<NoData, Mutex> - NoData_ptr; - - struct NoData : Profile - { - static u16 const id; - - public: - NoData (Header const& h, istream&) - : Profile (h) - { - } - - NoData () - : Profile (id) - { - Profile::size (0); - } - - NoData_ptr - clone () - { - return NoData_ptr (static_cast<NoData*> (clone_ ().release ())); - } - - protected: - virtual Profile_ptr - clone_ () - { - return new NoData (*this); - } - - NoData (NoData const& no_data) - : Profile (no_data) - { - } - - public: - virtual void - serialize_body (ostream&) const - { - } - - virtual void - serialize_body (sstream&) const - { - } - }; - - - // - // - // - struct Part; - - typedef - ACE_Refcounted_Auto_Ptr<Part, Mutex> - Part_ptr; - - struct Part : Profile - { - static u16 const id; - - public: - Part (Header const& h, istream& is) - : Profile (h) - { - is >> num_; - is >> of_; - is >> total_size_; - } - - Part (u32 num, u32 of, u64 total_size) - : Profile (id), - num_ (num), - of_ (of), - total_size_ (total_size) - { - size (calculate_size ()); - } - - Part_ptr - clone () - { - return Part_ptr (static_cast<Part*> (clone_ ().release ())); - } - - protected: - virtual Profile_ptr - clone_ () - { - return new Part (*this); - } - - Part (Part const& part) - : Profile (part), - num_ (part.num_), - of_ (part.of_), - total_size_ (part.total_size_) - { - } - - public: - u32 - num () const - { - return num_; - } - - u32 - of () const - { - return of_; - } - - u64 - total_size () const - { - return total_size_; - } - - public: - virtual void - serialize_body (ostream& os) const - { - os << num_; - os << of_; - os << total_size_; - } - - virtual void - serialize_body (sstream& ss) const - { - ss << num_; - ss << of_; - ss << total_size_; - } - - - private: - u32 num_; - u32 of_; - u64 total_size_; - }; - -} - -/* -inline -std::ostream& -operator<< (std::ostream& os, ACE_RMCast::Address const& a) -{ - char buf[64]; - a.addr_to_string (buf, 64, 1); - return os << buf; -} -*/ - -#endif // ACE_RMCAST_PROTOCOL_H diff --git a/protocols/ace/RMCast/README b/protocols/ace/RMCast/README deleted file mode 100644 index 9eda58871b0..00000000000 --- a/protocols/ace/RMCast/README +++ /dev/null @@ -1,197 +0,0 @@ - -Introduction ------------- - -RMCast is a reliable source-ordered multicast protocol implementation -for message-oriented multi-sender group communication built on top of -IPv4 multicast. It uses sequence numbers for re-ordering, duplicate -suppression and loss detection. Negative acknowledgments (NAK) with -retransmissions are used to recover from losses. - -One new and interesting idea implemented in this protocol is history -transmission (dubbed negative retransmission). In a nutshell, each -sender, along with normal payload, transmits a list of other sender's -IDs along with sequence numbers of last messages received from those -senders by this member. This, in some sense, builds a pyramid of -information: each subsequent message carries some information for a -number of previous messages (from other senders). This helps other -receivers detect losses. - -The protocol does not track group membership. Messages are retained -for retransmission for a predefined amount of time. The "last message -or lost message" dilemma is solved by periodic history transmissions -in cases when there is no useful traffic (idle network). - - -Examples --------- - -There is a simple example available in examples/RMCast/Send_Msg with -the corresponding README file. - - -Protocol --------- - -Over-the-wire representation is little-endian CDR. The protocol is -message-based with information encapsulated into one or multiple -profiles (Protocol.h): - - - -struct Profile -{ - u16 id; // Profile id. - u16 size; // Profile size. -}; - -struct Message -{ - u32 size; // Total size of the message. - sequence<Profile> profiles; // Sequence of profiles. -} - - - -The following profiles are defined (Protocol.h): - - - -struct From: Profile -{ - u32 addr; // IPv4 address. - u16 port; -}; - -The 'From' profile appears in each message. It is never transmitted -over the wire. Instead the 'Link' layer (see below) adds it. - - - -struct To: Profile -{ - u32 addr; // IPv4 address. - u16 port; -}; - -The 'To' profile also appears in each message. It is also never -transmitted over the wire since all communications are done via -well-known group address. It is added by the 'Link' layer and is used -by a group member to identify messages from itself ('From' == 'To'). - - - -struct Data: Profile -{ - sequence<octet> data; -}; - -The 'Data' profile is used to transmit user payload. - - - -struct SN: Profile -{ - u64 sn; -}; - -The 'SN' profile carries sequence number for 'Data' and 'NoData' profiles. - - - -struct NAK: Profile -{ - u32 addr; // IPv4 address. - u16 port; - - sequence<u64> sns; -}; - -The 'NAK' profile carries sequence numbers of all the messages originated -from the member identified by addr:port that the receiver detected were -lost. - - - -struct NRTM: Profile -{ - struct Pair - { - u32 addr; // IPv4 address. - u16 port; - - u64 max_sn; - }; - - sequence<Pair> nrtm; -}; - -The 'NRTM' profile carries highest sequence numbers known to this member -for (some sub-) set of members. It is used by other members to detect loses. -This profile is normally combined with 'Data' transmission. - - - -struct NoData: Profile -{ -}; - -The 'NoData' profile is send in reply to 'NAK' when the lost message is -no longer available. - - - -Below is the list of actions that trigger messages with various -profiles: - - -user calls send(): SN - Data - NRTM - -detected loss: NAK - - -received NAK: SN or SN - Data NoData - NRTM NRTM - - -Implementation --------------- - -This section describes high-level architecture of the implementation. -The protocol is implemented as a stack (Stack.h) of the following -elements: - -'Socket' -'Acknowledge' -'Retransmit' -'Link' - -The 'Socket' element is the user interface of the member. When a user -calls send() 'Socket' creates a new message with 'SN' and 'Data' profiles -and forwards it to the 'Acknowledge' element. It also receives (from -'Acknowledge') and queues incoming messages that are delivered to the user -when recv() is called. - -The 'Acknowledge' element is responsible for re-ordering, duplicate -suppression, loss detection and negative acknowledgments. It maintains a -dynamically changing "window" (which slides toward higher sequence -numbers) of received messages. Messages that arrive out of order are held -in this window. Presence of a hole in the windows for a long period of time -indicates loss and triggers a negative acknowledgment. - -The 'Retransmit' element is responsible for message retention, aging and -retransmission in response to NAKs. Each message received from the 'Socket' -element is held for predetermined amount of time in case retransmission is -required. Upon reception of a NAK duplicate is send if the requested message -is still available. Otherwise 'NoData' profile is sent. - - -The 'Link' element is responsible for interfacing with the IPv4 multicast -socket. It also parses over-the-wire representation into in-memory messages -with individually-accessible profiles. - --- -Boris Kolpackov <boris@kolpackov.net> diff --git a/protocols/ace/RMCast/RMCast.mpc b/protocols/ace/RMCast/RMCast.mpc deleted file mode 100644 index f77bd4d942c..00000000000 --- a/protocols/ace/RMCast/RMCast.mpc +++ /dev/null @@ -1,12 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(RMCast) : acelib, core, threads { - avoids = ace_for_tao - sharedname = ACE_RMCast - dynamicflags = ACE_RMCAST_BUILD_DLL - - Pkgconfig_Files { - ACE_RMCast.pc.in - } -} diff --git a/protocols/ace/RMCast/RMCast_Export.h b/protocols/ace/RMCast/RMCast_Export.h deleted file mode 100644 index 51257c4d682..00000000000 --- a/protocols/ace/RMCast/RMCast_Export.h +++ /dev/null @@ -1,44 +0,0 @@ -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by -// generate_export_file.pl -// ------------------------------ -#if !defined (ACE_RMCAST_EXPORT_H) -#define ACE_RMCAST_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (ACE_RMCAST_HAS_DLL) -# define ACE_RMCAST_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && ACE_RMCAST_HAS_DLL */ - -#if !defined (ACE_RMCAST_HAS_DLL) -#define ACE_RMCAST_HAS_DLL 1 -#endif /* ! ACE_RMCAST_HAS_DLL */ - -#if defined (ACE_RMCAST_HAS_DLL) -# if (ACE_RMCAST_HAS_DLL == 1) -# if defined (ACE_RMCAST_BUILD_DLL) -# define ACE_RMCast_Export ACE_Proper_Export_Flag -# define ACE_RMCAST_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define ACE_RMCAST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else -# define ACE_RMCast_Export ACE_Proper_Import_Flag -# define ACE_RMCAST_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define ACE_RMCAST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* ACE_RMCAST_BUILD_DLL */ -# else -# define ACE_RMCast_Export -# define ACE_RMCAST_SINGLETON_DECLARATION(T) -# define ACE_RMCAST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* ! ACE_RMCAST_HAS_DLL == 1 */ -#else -# define ACE_RMCast_Export -# define ACE_RMCAST_SINGLETON_DECLARATION(T) -# define ACE_RMCAST_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* ACE_RMCAST_HAS_DLL */ - -#endif /* ACE_RMCAST_EXPORT_H */ - -// End of auto generated file. diff --git a/protocols/ace/RMCast/Reassemble.cpp b/protocols/ace/RMCast/Reassemble.cpp deleted file mode 100644 index 9fa3e0d0167..00000000000 --- a/protocols/ace/RMCast/Reassemble.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// file : ace/RMCast/Reassemble.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#include "Reassemble.h" -#include "ace/OS_NS_stdlib.h" - -/* -#include <iostream> -using std::cerr; -using std::endl; -*/ - -namespace ACE_RMCast -{ - Reassemble:: - Reassemble (Parameters const& params) - : params_ (params) - { - } - - void Reassemble:: - recv (Message_ptr m) - { - Map::ENTRY* e; - Address from ( - static_cast<From const*> (m->find (From::id))->address ()); - - if (Data const* data = static_cast<Data const*> (m->find (Data::id))) - { - if (Part const* part = static_cast<Part const*> (m->find (Part::id))) - { - if (map_.find (from, e) == -1) - { - // First part of the message. - // - - if (part->num () != 1) - { - // We assume that we received NoData for one of the preceding - // fragments. Ignore this one. - return; - } - - Data_ptr new_data (new Data (data->buf (), - static_cast<size_t> (data->size ()), - static_cast<size_t> (part->total_size ()))); - - //std::cerr << "part->total_size (): " << part->total_size () << endl; - - map_.bind (from, new_data); - } - else - { - // Next part of the message. - // - - if (part->num () == 1) - ACE_OS::abort (); - - - Data const* data = static_cast<Data const*> (m->find (Data::id)); - - Data_ptr& new_data = e->int_id_; - - ACE_OS::memcpy (new_data->buf () + new_data->size (), - data->buf (), - data->size ()); - - //std::cerr << "data->size (): " << data->size () << endl - // << "new_data->size (): " << new_data->size () << endl - // << "new_data->capa (): " << new_data->capacity () << endl; - - new_data->size (new_data->size () + data->size ()); - - - if (part->num () == part->of ()) - { - // Reassembly is complete. - // - if (part->total_size () != new_data->size ()) - ACE_OS::abort (); - - Message_ptr new_msg (new Message ()); - - Address to ( - static_cast<To const*> (m->find (To::id))->address ()); - - new_msg->add (Profile_ptr (new To (to))); - new_msg->add (Profile_ptr (new From (from))); - new_msg->add (Profile_ptr (new_data.release ())); - - map_.unbind (from); - - in_->recv (new_msg); - } - } - } - else - { - // Non-fragmented message. Make sure we are in the consistent state - // and forward it up. - // - if (map_.find (from, e) != -1) - ACE_OS::abort (); - - in_->recv (m); - } - } - else if (m->find (NoData::id) != 0) - { - if (map_.find (from, e) != -1) - { - // We already received some fragments. Clean everyhting up. - // - map_.unbind (from); - } - - in_->recv (m); - } - } -} diff --git a/protocols/ace/RMCast/Reassemble.h b/protocols/ace/RMCast/Reassemble.h deleted file mode 100644 index cffa4fdc359..00000000000 --- a/protocols/ace/RMCast/Reassemble.h +++ /dev/null @@ -1,42 +0,0 @@ -// file : ace/RMCast/Reassemble.h -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#ifndef ACE_RMCAST_REASSEMBLE_H -#define ACE_RMCAST_REASSEMBLE_H - -#include "ace/Hash_Map_Manager.h" - -#include "Stack.h" -#include "Protocol.h" -#include "Bits.h" -#include "Parameters.h" - -namespace ACE_RMCast -{ - class Reassemble : public Element - { - public: - Reassemble (Parameters const& params); - - public: - virtual void - recv (Message_ptr m); - - private: - Parameters const& params_; - - typedef - ACE_Hash_Map_Manager_Ex<Address, - Data_ptr, - AddressHasher, - ACE_Equal_To<Address>, - ACE_Null_Mutex> - Map; - - Map map_; - }; -} - - -#endif // ACE_RMCAST_REASSEMBLE_H diff --git a/protocols/ace/RMCast/Retransmit.cpp b/protocols/ace/RMCast/Retransmit.cpp deleted file mode 100644 index b968908f82b..00000000000 --- a/protocols/ace/RMCast/Retransmit.cpp +++ /dev/null @@ -1,158 +0,0 @@ -// file : ace/RMCast/Retransmit.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#include "ace/Time_Value.h" // ACE_Time_Value -#include "ace/OS_NS_stdlib.h" // abort -#include "ace/OS_NS_sys_time.h" // gettimeofday - -#include "Retransmit.h" - -/* -#include <iostream> -using std::cerr; -using std::endl; -*/ - -namespace ACE_RMCast -{ - Retransmit:: - Retransmit (Parameters const& params) - : params_ (params), - cond_ (mutex_), - stop_ (false) - { - } - - void Retransmit:: - out_start (Out_Element* out) - { - Element::out_start (out); - - tracker_mgr_.spawn (track_thunk, this); - } - - void Retransmit:: - out_stop () - { - { - Lock l (mutex_); - stop_ = true; - cond_.signal (); - } - - tracker_mgr_.wait (); - - Element::out_stop (); - } - - void Retransmit:: - send (Message_ptr m) - { - if (m->find (Data::id) != 0) - { - SN const* sn = static_cast<SN const*> (m->find (SN::id)); - - Lock l (mutex_); - queue_.bind (sn->num (), Descr (m->clone ())); - } - - out_->send (m); - } - - void Retransmit:: - recv (Message_ptr m) - { - if (NAK const* nak = static_cast<NAK const*> (m->find (NAK::id))) - { - Address to (static_cast<To const*> (m->find (To::id))->address ()); - - if (nak->address () == to) - { - Lock l (mutex_); - - for (NAK::iterator j (const_cast<NAK*> (nak)->begin ()); - !j.done (); - j.advance ()) - { - u64* psn; - j.next (psn); - - Message_ptr m; - - Queue::ENTRY* pair; - - if (queue_.find (*psn, pair) == 0) - { - //cerr << 5 << "PRTM " << to << " " << pair->ext_id_ << endl; - - m = pair->int_id_.message (); - - pair->int_id_.reset (); - } - else - { - //cerr << 4 << "message " << *psn << " not available" << endl; - - m = Message_ptr (new Message); - m->add (Profile_ptr (new SN (*psn))); - m->add (Profile_ptr (new NoData)); - } - - out_->send (m); - } - } - } - - in_->recv (m); - } - - ACE_THR_FUNC_RETURN Retransmit:: - track_thunk (void* obj) - { - reinterpret_cast<Retransmit*> (obj)->track (); - return 0; - } - - void Retransmit:: - track () - { - while (true) - { - Lock l (mutex_); - - for (Queue::iterator i (queue_); !i.done ();) - { - if ((*i).int_id_.inc () >= params_.retention_timeout ()) - { - u64 sn ((*i).ext_id_); - i.advance (); - queue_.unbind (sn); - } - else - { - i.advance (); - } - } - - // Go to sleep but watch for "manual cancellation" request. - // - ACE_Time_Value time (ACE_OS::gettimeofday ()); - time += params_.tick (); - - while (!stop_) - { - if (cond_.wait (&time) == -1) - { - if (errno != ETIME) - ACE_OS::abort (); - else - break; - } - } - - if (stop_) - break; - } - } -} diff --git a/protocols/ace/RMCast/Retransmit.h b/protocols/ace/RMCast/Retransmit.h deleted file mode 100644 index 0a3a8f72bd7..00000000000 --- a/protocols/ace/RMCast/Retransmit.h +++ /dev/null @@ -1,98 +0,0 @@ -// file : ace/RMCast/Retransmit.h -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#ifndef ACE_RMCAST_RETRANSMIT_H -#define ACE_RMCAST_RETRANSMIT_H - -#include "ace/Hash_Map_Manager.h" -#include "ace/Thread_Manager.h" - -#include "Stack.h" -#include "Protocol.h" -#include "Bits.h" -#include "Parameters.h" - -namespace ACE_RMCast -{ - class Retransmit : public Element - { - public: - Retransmit (Parameters const& params); - - virtual void - out_start (Out_Element* out); - - virtual void - out_stop (); - - public: - virtual void - send (Message_ptr m); - - virtual void - recv (Message_ptr m); - - private: - struct Descr - { - // Shouldn't be available but ACE_Hash_Map needs it. - // - Descr () - : msg_ (), count_ (0) - { - } - - Descr (Message_ptr msg) - : msg_ (msg), count_ (0) - { - } - - unsigned long - inc () - { - return ++count_; - } - - void - reset () - { - count_ = 0; - } - - Message_ptr - message () const - { - return msg_->clone (); - } - - private: - Message_ptr msg_; - unsigned long count_; - }; - - typedef - ACE_Hash_Map_Manager<u64, Descr, ACE_Null_Mutex> - Queue; - - private: - void - track (); - - static ACE_THR_FUNC_RETURN - track_thunk (void* obj); - - private: - Parameters const& params_; - - Queue queue_; - Mutex mutex_; - Condition cond_; - - bool stop_; - ACE_Thread_Manager tracker_mgr_; - }; -} - - -#endif // ACE_RMCAST_RETRANSMIT_H diff --git a/protocols/ace/RMCast/Simulator.cpp b/protocols/ace/RMCast/Simulator.cpp deleted file mode 100644 index 8b024d1d299..00000000000 --- a/protocols/ace/RMCast/Simulator.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// file : ace/RMCast/Simulator.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#include "Simulator.h" - -namespace ACE_RMCast -{ - Simulator:: - Simulator () - { - srand (time (0)); - } - - void Simulator:: - send (Message_ptr m) - { - // Note: Simulator may work in unpredictable ways mainly due - // to the "reliable loopback" mechanism. - // - out_->send (m); - return; - - int r (rand ()); - - if ((r % 3) == 0) return; - - Lock l (mutex_); - - if (hold_.get ()) - { - out_->send (m); - out_->send (hold_); - } - else - { - hold_ = m; - } - } -} diff --git a/protocols/ace/RMCast/Simulator.h b/protocols/ace/RMCast/Simulator.h deleted file mode 100644 index 27b227f488b..00000000000 --- a/protocols/ace/RMCast/Simulator.h +++ /dev/null @@ -1,30 +0,0 @@ -// file : ace/RMCast/Simulator.h -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#ifndef ACE_RMCAST_SIMULATOR_H -#define ACE_RMCAST_SIMULATOR_H - -#include "Stack.h" -#include "Protocol.h" -#include "Bits.h" - -namespace ACE_RMCast -{ - class Simulator : public Element - { - public: - Simulator (); - - public: - virtual void - send (Message_ptr m); - - private: - Message_ptr hold_; - Mutex mutex_; - }; -} - - -#endif // ACE_RMCAST_SIMULATOR_H diff --git a/protocols/ace/RMCast/Socket.cpp b/protocols/ace/RMCast/Socket.cpp deleted file mode 100644 index 8f433f7c6ed..00000000000 --- a/protocols/ace/RMCast/Socket.cpp +++ /dev/null @@ -1,394 +0,0 @@ -// file : ace/RMCast/Socket.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#include "ace/OS_Memory.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_stdlib.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_sys_time.h" // gettimeofday - -#include "ace/Unbounded_Queue.h" - -#include "ace/Pipe.h" - -#include "Stack.h" -#include "Protocol.h" -#include "Bits.h" - -#include "Fragment.h" -#include "Reassemble.h" -#include "Acknowledge.h" -#include "Retransmit.h" -#include "Flow.h" -#include "Link.h" - -#include "Socket.h" - -/* -#include <iostream> -using std::cerr; -using std::endl; -*/ - -namespace ACE_RMCast -{ - class Socket_Impl : protected Element - { - public: - ~Socket_Impl (); - - Socket_Impl (Address const& a, bool loop, Parameters const& params); - - public: - void - send_ (void const* buf, size_t s); - - ssize_t - recv_ (void* buf, - size_t s, - ACE_Time_Value const* timeout, - ACE_INET_Addr* from); - - ssize_t - size_ (ACE_Time_Value const* timeout); - - ACE_HANDLE - get_handle_ (); - - private: - virtual void - recv (Message_ptr m); - - private: - bool loop_; - Parameters const params_; - - Mutex mutex_; - Condition cond_; - - ACE_Unbounded_Queue<Message_ptr> queue_; - - ACE_Pipe signal_pipe_; - - ACE_Auto_Ptr<Fragment> fragment_; - ACE_Auto_Ptr<Reassemble> reassemble_; - ACE_Auto_Ptr<Acknowledge> acknowledge_; - ACE_Auto_Ptr<Retransmit> retransmit_; - ACE_Auto_Ptr<Flow> flow_; - ACE_Auto_Ptr<Link> link_; - }; - - - Socket_Impl:: - Socket_Impl (Address const& a, bool loop, Parameters const& params) - : loop_ (loop), - params_ (params), - cond_ (mutex_) - { - fragment_.reset (new Fragment (params_)); - reassemble_.reset (new Reassemble (params_)); - acknowledge_.reset (new Acknowledge (params_)); - retransmit_.reset (new Retransmit (params_)); - flow_.reset (new Flow (params_)); - link_.reset (new Link (a, params_)); - - // Start IN stack from top to bottom. - // - in_start (0); - fragment_->in_start (this); - reassemble_->in_start (fragment_.get ()); - acknowledge_->in_start (reassemble_.get ()); - retransmit_->in_start (acknowledge_.get ()); - flow_->in_start (retransmit_.get ()); - link_->in_start (flow_.get ()); - - // Start OUT stack from bottom up. - // - link_->out_start (0); - flow_->out_start (link_.get ()); - retransmit_->out_start (flow_.get ()); - acknowledge_->out_start (retransmit_.get ()); - reassemble_->out_start (acknowledge_.get ()); - fragment_->out_start (reassemble_.get ()); - out_start (fragment_.get ()); - } - - Socket_Impl:: - ~Socket_Impl () - { - // Stop OUT stack from top to bottom. - // - out_stop (); - fragment_->out_stop (); - reassemble_->out_stop (); - acknowledge_->out_stop (); - retransmit_->out_stop (); - flow_->out_stop (); - link_->out_stop (); - - // Stop IN stack from bottom up. - // - link_->in_stop (); - flow_->in_stop (); - retransmit_->in_stop (); - acknowledge_->in_stop (); - reassemble_->in_stop (); - fragment_->in_stop (); - in_stop (); - } - - - void Socket_Impl:: - send_ (void const* buf, size_t s) - { - Message_ptr m (new Message); - - m->add (Profile_ptr (new Data (buf, s))); - - // Qualification is for VC6 and VxWorks. - // - Element::send (m); - } - - ssize_t Socket_Impl:: - recv_ (void* buf, - size_t s, - ACE_Time_Value const* timeout, - ACE_INET_Addr* from) - { - ACE_Time_Value abs_time; - - if (timeout) - abs_time = ACE_OS::gettimeofday () + *timeout; - - Lock l (mutex_); - - while (queue_.is_empty ()) - { - if (timeout) - { - if (cond_.wait (&abs_time) != -1) - break; - } - else - { - if (cond_.wait () != -1) - break; - } - - return -1; // errno is already set - } - - - Message_ptr m; - - if (queue_.dequeue_head (m) == -1) - ACE_OS::abort (); - - - if (queue_.is_empty ()) - { - // Remove data from the pipe. - // - if (signal_pipe_.read_handle () != ACE_INVALID_HANDLE) - { - char c; - - if (signal_pipe_.recv (&c, 1) != 1) - { - ACE_OS::perror ("read: "); - ACE_OS::abort (); - } - } - } - - if (from) - *from = static_cast<From const*> (m->find (From::id))->address (); - - if (m->find (NoData::id) != 0) - { - errno = ENOENT; - return -1; - } - - Data const* d = static_cast<Data const*>(m->find (Data::id)); - - ssize_t r (static_cast<ssize_t> (d->size () < s ? d->size () : s)); - - ACE_OS::memcpy (buf, d->buf (), r); - - return r; - } - - ssize_t Socket_Impl:: - size_ (ACE_Time_Value const* timeout) - { - ACE_Time_Value abs_time; - - if (timeout) - abs_time = ACE_OS::gettimeofday () + *timeout; - - Lock l (mutex_); - - while (queue_.is_empty ()) - { - if (timeout) - { - if (cond_.wait (&abs_time) != -1) - break; - } - else - { - if (cond_.wait () != -1) - break; - } - - return -1; // errno is already set - } - - // I can't get the head of the queue without actually dequeuing - // the element. - // - Message_ptr m; - - if (queue_.dequeue_head (m) == -1) - ACE_OS::abort (); - - if (queue_.enqueue_head (m) == -1) - ACE_OS::abort (); - - if (m->find (NoData::id) != 0) - { - errno = ENOENT; - return -1; - } - - Data const* d = static_cast<Data const*>(m->find (Data::id)); - - return static_cast<ssize_t> (d->size ()); - } - - ACE_HANDLE Socket_Impl:: - get_handle_ () - { - if (signal_pipe_.read_handle () == ACE_INVALID_HANDLE) - { - signal_pipe_.open (); - } - - return signal_pipe_.read_handle (); - } - - - void Socket_Impl:: - recv (Message_ptr m) - { - if (m->find (Data::id) != 0 || m->find (NoData::id) != 0) - { - if (!loop_) - { - Address to (static_cast<To const*> (m->find (To::id))->address ()); - - Address from ( - static_cast<From const*> (m->find (From::id))->address ()); - - if (to == from) - return; - } - - Lock l (mutex_); - - //if (queue_.size () != 0) - // cerr << "recv socket queue size: " << queue_.size () << endl; - - bool signal (queue_.is_empty ()); - - queue_.enqueue_tail (m); - - if (signal) - { - // Also write to the pipe. - if (signal_pipe_.write_handle () != ACE_INVALID_HANDLE) - { - char c; - - if (signal_pipe_.send (&c, 1) != 1) - { - // perror ("write: "); - ACE_OS::abort (); - } - } - - cond_.signal (); - } - } - } - - - // Socket - // - // - Socket:: - ~Socket () - { - } - - Socket:: - Socket (Address const& a, bool loop, Parameters const& params) - : impl_ (new Socket_Impl (a, loop, params)) - { - } - - void Socket:: - send (void const* buf, size_t s) - { - impl_->send_ (buf, s); - } - - ssize_t Socket:: - recv (void* buf, size_t s) - { - return impl_->recv_ (buf, s, 0, 0); - } - - ssize_t Socket:: - recv (void* buf, size_t s, ACE_INET_Addr& from) - { - return impl_->recv_ (buf, s, 0, &from); - } - - ssize_t Socket:: - recv (void* buf, size_t s, ACE_Time_Value const& timeout) - { - return impl_->recv_ (buf, s, &timeout, 0); - } - - ssize_t Socket:: - recv (void* buf, - size_t s, - ACE_Time_Value const& timeout, - ACE_INET_Addr& from) - { - return impl_->recv_ (buf, s, &timeout, &from); - } - - ssize_t Socket:: - size () - { - return impl_->size_ (0); - } - - ssize_t Socket:: - size (ACE_Time_Value const& timeout) - { - return impl_->size_ (&timeout); - } - - ACE_HANDLE Socket:: - get_handle () - { - return impl_->get_handle_ (); - } -} diff --git a/protocols/ace/RMCast/Socket.h b/protocols/ace/RMCast/Socket.h deleted file mode 100644 index 3468df15d4d..00000000000 --- a/protocols/ace/RMCast/Socket.h +++ /dev/null @@ -1,99 +0,0 @@ -// file : ace/RMCast/Socket.h -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#ifndef ACE_RMCAST_SOCKET_H -#define ACE_RMCAST_SOCKET_H - -#include "ace/config-lite.h" // ACE_HANDLE - -#include "ace/Auto_Ptr.h" -#include "ace/INET_Addr.h" -#include "ace/Time_Value.h" - -#include "RMCast_Export.h" -#include "Parameters.h" - - -namespace ACE_RMCast -{ - class Socket_Impl; - - class ACE_RMCast_Export Socket - { - public: - virtual - ~Socket (); - - // If 'simulator' is 'true' then internal message loss and - // reordering simulator (on IPv4 level) is turned on. - // - Socket (ACE_INET_Addr const& a, - bool loop = true, - Parameters const& params = Parameters ()); - - public: - virtual void - send (void const* buf, size_t s); - - - // Block if message is not available. Upon successful completion - // return the next message. Otherwise return -1 and errno set to - // indicate the error. ENOENT indicates that the sender does not - // retain the data for this message anymore. - // - virtual ssize_t - recv (void* buf, size_t s); - - virtual ssize_t - recv (void* buf, size_t s, ACE_INET_Addr& from); - - - // Block for up to <timeout> until message is available. Upon - // successful completion return the next message. Otherwise - // return -1 and errno set to indicate the error. ETIME indicates - // that the operation timed out. ENOENT indicates that the sender - // does not retain the data for this message anymore. - // - virtual ssize_t - recv (void* buf, size_t s, ACE_Time_Value const& timeout); - - virtual ssize_t - recv (void* buf, - size_t s, - ACE_Time_Value const& timeout, - ACE_INET_Addr& from); - - - // Block if message is not available. Upon successful completion - // return the size of the next message. Otherwise return -1 and - // errno set to indicate the error. ENOENT indicates that the - // sender does not retain the data for this message anymore. - // - virtual ssize_t - size (); - - - // Block for up to <timeout> until message is available. Upon - // successful completion return the size of the next message. - // Otherwise return -1 and errno set to indicate the error. - // ETIME indicates that the operation timed out. ENOENT indicates - // that the sender does not retain the data for this message anymore. - // - virtual ssize_t - size (ACE_Time_Value const& timeout); - - public: - // Reactor interface. Note that the handle returned by get_handle() - // is for signalling purposes only. - // - ACE_HANDLE - get_handle (); - - private: - ACE_Auto_Ptr<Socket_Impl> impl_; - }; -} - - -#endif // ACE_RMCAST_SOCKET_H diff --git a/protocols/ace/RMCast/Stack.cpp b/protocols/ace/RMCast/Stack.cpp deleted file mode 100644 index aa62558b4c9..00000000000 --- a/protocols/ace/RMCast/Stack.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// file : ace/RMCast/Stack.cpp -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#include "Stack.h" - -namespace ACE_RMCast -{ - // Out_Element - // - - Out_Element:: - ~Out_Element () - { - } - - Out_Element:: - Out_Element () - : out_ (0) - { - } - - void Out_Element:: - out_start (Out_Element* out) - { - out_ = out; - } - - void Out_Element:: - send (Message_ptr m) - { - if (out_) out_->send (m); - } - - void Out_Element:: - out_stop () - { - out_ = 0; - } - - - // In_Element - // - - In_Element:: - ~In_Element () - { - } - - In_Element:: - In_Element () - : in_ (0) - { - } - - void In_Element:: - in_start (In_Element* in) - { - in_ = in; - } - - void In_Element:: - recv (Message_ptr m) - { - if (in_) in_->recv (m); - } - - void In_Element:: - in_stop () - { - in_ = 0; - } -} diff --git a/protocols/ace/RMCast/Stack.h b/protocols/ace/RMCast/Stack.h deleted file mode 100644 index 322fe0dc501..00000000000 --- a/protocols/ace/RMCast/Stack.h +++ /dev/null @@ -1,59 +0,0 @@ -// file : ace/RMCast/Stack.h -// author : Boris Kolpackov <boris@kolpackov.net> -// cvs-id : $Id$ - -#ifndef ACE_RMCAST_STACK_H -#define ACE_RMCAST_STACK_H - -#include "Protocol.h" - -namespace ACE_RMCast -{ - struct Out_Element - { - virtual - ~Out_Element (); - - Out_Element (); - - virtual void - out_stop (); - - virtual void - out_start (Out_Element* out); - - virtual void - send (Message_ptr m); - - protected: - Out_Element* out_; - }; - - - struct In_Element - { - virtual - ~In_Element (); - - In_Element (); - - virtual void - in_stop (); - - virtual void - in_start (In_Element* in); - - virtual void - recv (Message_ptr m); - - protected: - In_Element* in_; - }; - - - struct Element : In_Element, Out_Element - { - }; -} - -#endif // ACE_RMCAST_STACK_H diff --git a/protocols/ace/RMCast/Template_Instantiations.cpp b/protocols/ace/RMCast/Template_Instantiations.cpp deleted file mode 100644 index 262a8e5b36a..00000000000 --- a/protocols/ace/RMCast/Template_Instantiations.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// $Id$ - -// Note: this file is here only until support for explicit template -// instantiations is removed from ACE, after ACE 5.5 is released. - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) || \ - defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -# include "ace/Array_Base.h" -# include "ace/Condition_T.h" -# include "ace/Functor_T.h" -# include "ace/Hash_Map_Manager.h" -# include "ace/INET_Addr.h" -# include "ace/Refcounted_Auto_Ptr.h" -# include "ace/Thread_Mutex.h" -# include "ace/Unbounded_Queue.h" -# include "ace/Vector_T.h" - -# include "Acknowledge.h" -# include "Protocol.h" -# include "Retransmit.h" - -#endif - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - -template class ACE_Array_Base<unsigned char>; -template class ACE_Array_Base<ACE_RMCast::u64>; -template class ACE_Array_Base<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Null_Mutex> >; -template class ACE_Array_Base<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Thread_Mutex> >; -template class ACE_Condition<ACE_Thread_Mutex>; -template class ACE_Equal_To<ACE_INET_Addr>; -template class ACE_Hash_Map_Const_Iterator_Base_Ex<unsigned short, ACE_Refcounted_Auto_Ptr<ACE_RMCast::Profile, ACE_Thread_Mutex>, ACE_Hash<unsigned short>, ACE_Equal_To<unsigned short>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Const_Iterator_Base_Ex<ACE_RMCast::u64, ACE_RMCast::Acknowledge::Descr, ACE_Hash<ACE_RMCast::u64>, ACE_Equal_To<ACE_RMCast::u64>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Const_Iterator_Base_Ex<ACE_INET_Addr, ACE_RMCast::u64, ACE_RMCast::AddressHasher, ACE_Equal_To<ACE_INET_Addr>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex<ACE_INET_Addr, ACE_RMCast::Acknowledge::Queue, ACE_RMCast::AddressHasher, ACE_Equal_To<ACE_INET_Addr>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex<ACE_RMCast::u64, ACE_RMCast::Acknowledge::Descr, ACE_Hash<ACE_RMCast::u64>, ACE_Equal_To<ACE_RMCast::u64>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Iterator_Base_Ex<ACE_RMCast::u64, ACE_RMCast::Retransmit::Descr, ACE_Hash<ACE_RMCast::u64>, ACE_Equal_To<ACE_RMCast::u64>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Entry<ACE_RMCast::u64, ACE_RMCast::Acknowledge::Descr>; -template class ACE_Hash_Map_Entry<ACE_RMCast::u64, ACE_RMCast::Retransmit::Descr>; -template class ACE_Hash_Map_Entry<unsigned short, ACE_Refcounted_Auto_Ptr<ACE_RMCast::Profile, ACE_Thread_Mutex> >; -template class ACE_Hash_Map_Entry<ACE_INET_Addr, ACE_RMCast::u64>; -template class ACE_Hash_Map_Entry<ACE_INET_Addr, ACE_Refcounted_Auto_Ptr<ACE_RMCast::Data, ACE_Thread_Mutex> >; -template class ACE_Hash_Map_Entry<ACE_INET_Addr, ACE_RMCast::Acknowledge::Queue>; -template class ACE_Hash_Map_Manager<ACE_RMCast::u64, ACE_RMCast::Acknowledge::Descr, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager<ACE_RMCast::u64, ACE_RMCast::Retransmit::Descr, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager<unsigned short, ACE_Refcounted_Auto_Ptr<ACE_RMCast::Profile, ACE_Thread_Mutex>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<ACE_INET_Addr, ACE_Refcounted_Auto_Ptr<ACE_RMCast::Data, ACE_Thread_Mutex>, ACE_RMCast::AddressHasher, ACE_Equal_To<ACE_INET_Addr>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<ACE_INET_Addr, ACE_RMCast::Acknowledge::Queue, ACE_RMCast::AddressHasher, ACE_Equal_To<ACE_INET_Addr>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<ACE_INET_Addr, ACE_RMCast::u64, ACE_RMCast::AddressHasher, ACE_Equal_To<ACE_INET_Addr>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<ACE_RMCast::u64, ACE_RMCast::Acknowledge::Descr, ACE_Hash<ACE_RMCast::u64>, ACE_Equal_To<ACE_RMCast::u64>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<ACE_RMCast::u64, ACE_RMCast::Retransmit::Descr, ACE_Hash<ACE_RMCast::u64>, ACE_Equal_To<ACE_RMCast::u64>, ACE_Null_Mutex>; -template class ACE_Hash_Map_Manager_Ex<unsigned short, ACE_Refcounted_Auto_Ptr<ACE_RMCast::Profile, ACE_Thread_Mutex>, ACE_Hash<unsigned short>, ACE_Equal_To<unsigned short>, ACE_Null_Mutex>; -template class ACE_Node<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Null_Mutex> >; -template class ACE_Node<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Thread_Mutex> >; -template class ACE_Refcounted_Auto_Ptr<ACE_RMCast::Data, ACE_Thread_Mutex>; -template class ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Null_Mutex>; -template class ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Thread_Mutex>; -template class ACE_Refcounted_Auto_Ptr<ACE_RMCast::NAK, ACE_Thread_Mutex>; -template class ACE_Refcounted_Auto_Ptr<ACE_RMCast::NRTM, ACE_Thread_Mutex>; -template class ACE_Refcounted_Auto_Ptr<ACE_RMCast::Profile, ACE_Thread_Mutex>; -template class ACE_Unbounded_Queue<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Null_Mutex> >; -template class ACE_Unbounded_Queue<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Thread_Mutex> >; -template class ACE_Unbounded_Queue_Iterator<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Null_Mutex> >; -template class ACE_Unbounded_Queue_Iterator<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Thread_Mutex> >; -template class ACE_Vector<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Null_Mutex> >; -template class ACE_Vector<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Thread_Mutex> >; -template class ACE_Vector<unsigned char>; -template class ACE_Vector<ACE_RMCast::u64>; -template class ACE_Vector_Iterator<unsigned char>; -template class ACE_Vector_Iterator<ACE_RMCast::u64>; -template class ACE_Vector_Iterator<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Null_Mutex> >; -template class ACE_Vector_Iterator<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Thread_Mutex> >; - -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - -# pragma instantiate class ACE_Array_Base<unsigned char> -# pragma instantiate class ACE_Array_Base<ACE_RMCast::u64> -# pragma instantiate class ACE_Array_Base<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Null_Mutex> > -# pragma instantiate class ACE_Array_Base<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Thread_Mutex> > -# pragma instantiate class ACE_Condition<ACE_Thread_Mutex> -# pragma instantiate class ACE_Equal_To<ACE_INET_Addr> -# pragma instantiate class ACE_Hash_Map_Const_Iterator_Base_Ex<ACE_RMCast::u64, ACE_RMCast::Acknowledge::Descr, ACE_Hash<ACE_RMCast::u64>, ACE_Equal_To<ACE_RMCast::u64>, ACE_Null_Mutex> -# pragma instantiate class ACE_Hash_Map_Const_Iterator_Base_Ex<unsigned short, ACE_Refcounted_Auto_Ptr<ACE_RMCast::Profile, ACE_Thread_Mutex>, ACE_Hash<unsigned short>, ACE_Equal_To<unsigned short>, ACE_Null_Mutex> -# pragma instantiate class ACE_Hash_Map_Const_Iterator_Base_Ex<ACE_INET_Addr, ACE_RMCast::u64, ACE_RMCast::AddressHasher, ACE_Equal_To<ACE_INET_Addr>, ACE_Null_Mutex> -# pragma instantiate class ACE_Hash_Map_Iterator_Base_Ex<ACE_INET_Addr, ACE_RMCast::Acknowledge::Queue, ACE_RMCast::AddressHasher, ACE_Equal_To<ACE_INET_Addr>, ACE_Null_Mutex> -# pragma instantiate class ACE_Hash_Map_Iterator_Base_Ex<ACE_RMCast::u64, ACE_RMCast::Acknowledge::Descr, ACE_Hash<ACE_RMCast::u64>, ACE_Equal_To<ACE_RMCast::u64>, ACE_Null_Mutex> -# pragma instantiate class ACE_Hash_Map_Iterator_Base_Ex<ACE_RMCast::u64, ACE_RMCast::Retransmit::Descr, ACE_Hash<ACE_RMCast::u64>, ACE_Equal_To<ACE_RMCast::u64>, ACE_Null_Mutex> -# pragma instantiate class ACE_Hash_Map_Entry<ACE_RMCast::u64, ACE_RMCast::Acknowledge::Descr> -# pragma instantiate class ACE_Hash_Map_Entry<ACE_RMCast::u64, ACE_RMCast::Retransmit::Descr> -# pragma instantiate class ACE_Hash_Map_Entry<unsigned short, ACE_Refcounted_Auto_Ptr<ACE_RMCast::Profile, ACE_Thread_Mutex> > -# pragma instantiate class ACE_Hash_Map_Entry<ACE_INET_Addr, ACE_RMCast::u64> -# pragma instantiate class ACE_Hash_Map_Entry<ACE_INET_Addr, ACE_Refcounted_Auto_Ptr<ACE_RMCast::Data, ACE_Thread_Mutex> > -# pragma instantiate class ACE_Hash_Map_Entry<ACE_INET_Addr, ACE_RMCast::Acknowledge::Queue> -# pragma instantiate class ACE_Hash_Map_Manager<ACE_RMCast::u64, ACE_RMCast::Acknowledge::Descr, ACE_Null_Mutex> -# pragma instantiate class ACE_Hash_Map_Manager<ACE_RMCast::u64, ACE_RMCast::Retransmit::Descr, ACE_Null_Mutex> -# pragma instantiate class ACE_Hash_Map_Manager<unsigned short, ACE_Refcounted_Auto_Ptr<ACE_RMCast::Profile, ACE_Thread_Mutex>, ACE_Null_Mutex> -# pragma instantiate class ACE_Hash_Map_Manager_Ex<ACE_INET_Addr, ACE_Refcounted_Auto_Ptr<ACE_RMCast::Data, ACE_Thread_Mutex>, ACE_RMCast::AddressHasher, ACE_Equal_To<ACE_INET_Addr>, ACE_Null_Mutex> -# pragma instantiate class ACE_Hash_Map_Manager_Ex<ACE_INET_Addr, ACE_RMCast::Acknowledge::Queue, ACE_RMCast::AddressHasher, ACE_Equal_To<ACE_INET_Addr>, ACE_Null_Mutex> -# pragma instantiate class ACE_Hash_Map_Manager_Ex<ACE_INET_Addr, ACE_RMCast::u64, ACE_RMCast::AddressHasher, ACE_Equal_To<ACE_INET_Addr>, ACE_Null_Mutex> -# pragma instantiate class ACE_Hash_Map_Manager_Ex<ACE_RMCast::u64, ACE_RMCast::Acknowledge::Descr, ACE_Hash<ACE_RMCast::u64>, ACE_Equal_To<ACE_RMCast::u64>, ACE_Null_Mutex> -# pragma instantiate class ACE_Hash_Map_Manager_Ex<ACE_RMCast::u64, ACE_RMCast::Retransmit::Descr, ACE_Hash<ACE_RMCast::u64>, ACE_Equal_To<ACE_RMCast::u64>, ACE_Null_Mutex> -# pragma instantiate class ACE_Hash_Map_Manager_Ex<unsigned short, ACE_Refcounted_Auto_Ptr<ACE_RMCast::Profile, ACE_Thread_Mutex>, ACE_Hash<unsigned short>, ACE_Equal_To<unsigned short>, ACE_Null_Mutex> -# pragma instantiate class ACE_Node<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Null_Mutex> > -# pragma instantiate class ACE_Node<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Thread_Mutex> > -# pragma instantiate class ACE_Refcounted_Auto_Ptr<ACE_RMCast::Data, ACE_Thread_Mutex> -# pragma instantiate class ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Null_Mutex> -# pragma instantiate class ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Thread_Mutex> -# pragma instantiate class ACE_Refcounted_Auto_Ptr<ACE_RMCast::NAK, ACE_Thread_Mutex> -# pragma instantiate class ACE_Refcounted_Auto_Ptr<ACE_RMCast::NRTM, ACE_Thread_Mutex> -# pragma instantiate class ACE_Refcounted_Auto_Ptr<ACE_RMCast::Profile, ACE_Thread_Mutex> -# pragma instantiate class ACE_Unbounded_Queue<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Null_Mutex> > -# pragma instantiate class ACE_Unbounded_Queue<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Thread_Mutex> > -# pragma instantiate class ACE_Unbounded_Queue_Iterator<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Null_Mutex> > -# pragma instantiate class ACE_Unbounded_Queue_Iterator<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Thread_Mutex> > -# pragma instantiate class ACE_Vector<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Null_Mutex> > -# pragma instantiate class ACE_Vector<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Thread_Mutex> > -# pragma instantiate class ACE_Vector<unsigned char> -# pragma instantiate class ACE_Vector<ACE_RMCast::u64> -# pragma instantiate class ACE_Vector_Iterator<unsigned char> -# pragma instantiate class ACE_Vector_Iterator<ACE_RMCast::u64> -# pragma instantiate class ACE_Vector_Iterator<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Null_Mutex> > -# pragma instantiate class ACE_Vector_Iterator<ACE_Refcounted_Auto_Ptr<ACE_RMCast::Message, ACE_Thread_Mutex> > - -#elif defined (__HP_aCC) -// Make aC++ stop complaining about an empty translation unit -static int shut_up_aCC = 0; -#endif |