summaryrefslogtreecommitdiff
path: root/apps/Gateway/Peer
diff options
context:
space:
mode:
Diffstat (limited to 'apps/Gateway/Peer')
-rw-r--r--apps/Gateway/Peer/Event.h125
-rw-r--r--apps/Gateway/Peer/Gateway_Handler.cpp652
-rw-r--r--apps/Gateway/Peer/Gateway_Handler.h154
-rw-r--r--apps/Gateway/Peer/Makefile136
-rw-r--r--apps/Gateway/Peer/Options.cpp188
-rw-r--r--apps/Gateway/Peer/Options.h133
-rw-r--r--apps/Gateway/Peer/Peer.cpp844
-rw-r--r--apps/Gateway/Peer/Peer.dsp64
-rw-r--r--apps/Gateway/Peer/Peer.dsw44
-rw-r--r--apps/Gateway/Peer/Peer.h230
-rw-r--r--apps/Gateway/Peer/Peer4.mak594
-rw-r--r--apps/Gateway/Peer/Peer4.mdpbin49664 -> 0 bytes
-rw-r--r--apps/Gateway/Peer/Peer_Message.h44
-rw-r--r--apps/Gateway/Peer/peerd.cpp60
-rw-r--r--apps/Gateway/Peer/peerd.dsp57
-rw-r--r--apps/Gateway/Peer/svc.conf2
16 files changed, 0 insertions, 3327 deletions
diff --git a/apps/Gateway/Peer/Event.h b/apps/Gateway/Peer/Event.h
deleted file mode 100644
index 5e288edf910..00000000000
--- a/apps/Gateway/Peer/Event.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -*- C++ -*- */
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// apps
-//
-// = FILENAME
-// Event.h
-//
-// = AUTHOR
-// Doug Schmidt
-//
-// ============================================================================
-
-#if !defined (EVENT)
-#define EVENT
-
-#include "ace/OS.h"
-
-// This is the unique connection identifier that denotes a particular
-// Proxy_Handler in the Gateway.
-typedef ACE_INT32 ACE_INT32;
-
-class Event_Key
- // = TITLE
- // Address used to identify the source/destination of an event.
- //
- // = DESCRIPTION
- // This is really a "virtual forwarding address" thatis used to
- // decouple the filtering and forwarding logic of the Event
- // Channel from the format of the data.
-{
-public:
- Event_Key (ACE_INT32 cid = -1,
- u_char sid = 0,
- u_char type = 0)
- : conn_id_ (cid),
- supplier_id_ (sid),
- type_ (type) {}
-
- int operator== (const Event_Key &event_addr) const
- {
- return this->conn_id_ == event_addr.conn_id_
- && this->supplier_id_ == event_addr.supplier_id_
- && this->type_ == event_addr.type_;
- }
-
- ACE_INT32 conn_id_;
- // Unique connection identifier that denotes a particular
- // Proxy_Handler.
-
- ACE_INT32 supplier_id_;
- // Logical ID.
-
- ACE_INT32 type_;
- // Event type.
-};
-
-class Event_Header
- // = TITLE
- // Fixed sized header.
- //
- // = DESCRIPTION
- // This is designed to have a sizeof (16) to avoid alignment
- // problems on most platforms.
-{
-public:
- typedef ACE_INT32 SUPPLIER_ID;
- // Type used to forward events from gatewayd.
-
- enum
- {
- INVALID_ID = -1 // No peer can validly use this number.
- };
-
- void decode (void)
- {
- this->len_ = ntohl (this->len_);
- this->supplier_id_ = ntohl (this->supplier_id_);
- this->type_ = ntohl (this->type_);
- this->priority_ = ntohl (this->priority_);
- }
- // Decode from network byte order to host byte order.
-
- void encode (void)
- {
- this->len_ = htonl (this->len_);
- this->supplier_id_ = htonl (this->supplier_id_);
- this->type_ = htonl (this->type_);
- this->priority_ = htonl (this->priority_);
- }
- // Encode from host byte order to network byte order.
-
- size_t len_;
- // Length of the data_ payload, in bytes.
-
- SUPPLIER_ID supplier_id_;
- // Source ID.
-
- ACE_INT32 type_;
- // Event type.
-
- ACE_INT32 priority_;
- // Event priority.
-};
-
-class Event
- // = TITLE
- // Variable-sized event (data_ may be variable-sized between
- // 0 and MAX_PAYLOAD_SIZE).
-{
-public:
- enum { MAX_PAYLOAD_SIZE = 1024 };
- // The maximum size of an Event.
-
- Event_Header header_;
- // Event header.
-
- char data_[MAX_PAYLOAD_SIZE];
- // Event data.
-};
-
-#endif /* EVENT */
diff --git a/apps/Gateway/Peer/Gateway_Handler.cpp b/apps/Gateway/Peer/Gateway_Handler.cpp
deleted file mode 100644
index cfc9a7dad6f..00000000000
--- a/apps/Gateway/Peer/Gateway_Handler.cpp
+++ /dev/null
@@ -1,652 +0,0 @@
-#include "ace/Get_Opt.h"
-// $Id$
-
-
-#include "Gateway_Handler.h"
-
-Gateway_Handler::Gateway_Handler (ACE_Thread_Manager *)
- : routing_id_ (0),
- msg_frag_ (0),
- total_bytes_ (0)
-{
- this->msg_queue ()->high_water_mark (Gateway_Handler::QUEUE_SIZE);
-}
-
-int
-Gateway_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *)
-{
- ACE_DEBUG ((LM_DEBUG, "(%t) %S\n", signum));
-
- // Shut down the main event loop.
- ACE_Service_Config::end_reactor_event_loop ();
- return 0;
-}
-
-// Cache a binding to the HANDLER_MAP.
-
-void
-Gateway_Handler::map (HANDLER_MAP *m)
-{
- this->map_ = m;
-}
-
-// Upcall from the ACE_Acceptor::handle_input() that turns control
-// over to our application-specific Gateway handler.
-
-int
-Gateway_Handler::open (void *a)
-{
- ACE_DEBUG ((LM_DEBUG, "Gateway handler's fd = %d\n",
- this->peer ().get_handle ()));
-
- // Call down to the base class to activate and register this
- // handler.
- if (this->inherited::open (a) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), -1);
-
- if (this->peer ().enable (ACE_NONBLOCK) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "enable"), -1);
-
- Gateway_Handler *this_ = this;
-
- // Add ourselves to the map so we can be removed later on.
- if (this->map_->bind (this->get_handle (), this_) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "bind"), -1);
-
- char *to = ACE_OS::getenv ("TIMEOUT");
- int timeout = to == 0 ? 100000 : ACE_OS::atoi (to);
-
- // Schedule the time between disconnects. This should really be a
- // "tunable" parameter.
- if (ACE_Service_Config::reactor ()->schedule_timer (this, 0, timeout) == -1)
- ACE_ERROR ((LM_ERROR, "%p\n", "schedule_timer"));
-
- // If there are messages left in the queue, make sure we
- // enable the ACE_Reactor appropriately to get them sent out.
- if (this->msg_queue ()->is_empty () == 0
- && ACE_Service_Config::reactor ()->schedule_wakeup (this,
- ACE_Event_Handler::WRITE_MASK) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "schedule_wakeup"), -1);
-
- // First action is to wait to be notified of our routing id.
- this->do_action_ = &Gateway_Handler::await_route_id;
- return 0;
-}
-
-// Read messages from stdin and send them to the gatewayd.
-
-int
-Gateway_Handler::xmit_stdin (void)
-{
- if (this->routing_id_ != -1)
- {
- ssize_t n;
- ACE_Message_Block *mb;
-
- ACE_NEW_RETURN (mb,
- ACE_Message_Block (sizeof (Event)),
- -1);
-
- Event *peer_msg = (Event *) mb->rd_ptr ();
- peer_msg->header_.routing_id_ = this->routing_id_;
-
- n = ACE_OS::read (ACE_STDIN, peer_msg->buf_, sizeof peer_msg->buf_);
-
- switch (n)
- {
- case 0:
- ACE_DEBUG ((LM_DEBUG, "stdin closing down\n"));
-
- // Take stdin out of the ACE_Reactor so we stop trying to
- // send messages.
- if (ACE_Service_Config::reactor ()->remove_handler
- (0, ACE_Event_Handler::DONT_CALL | ACE_Event_Handler::READ_MASK) == -1)
- ACE_ERROR ((LM_ERROR, "%p\n", "remove_handler"));
- delete mb;
- break;
- case -1:
- delete mb;
- ACE_ERROR ((LM_ERROR, "%p\n", "read"));
- break;
- default:
- peer_msg->header_.len_ = htonl (n);
- mb->wr_ptr (sizeof (Peer_Header) + n);
-
- if (this->put (mb) == -1)
- {
- if (errno == EWOULDBLOCK) // The queue has filled up!
- ACE_ERROR ((LM_ERROR, "%p\n",
- "gateway is flow controlled, so we're dropping messages"));
- else
- ACE_ERROR ((LM_ERROR, "%p\n", "transmission failure in xmit_stdin"));
-
- // Caller is responsible for freeing a ACE_Message_Block
- // if failures occur.
- delete mb;
- }
- }
- }
- return 0;
-}
-
-// Perform a non-blocking put() of message MB. If we are unable to
-// send the entire message the remainder is re-Taskd at the *front* of
-// the Message_List.
-
-int
-Gateway_Handler::nonblk_put (ACE_Message_Block *mb)
-{
- // Try to send the message. If we don't send it all (e.g., due to
- // flow control), then re-ACE_Task the remainder at the head of the
- // Message_List and ask the ACE_Reactor to inform us (via
- // handle_output()) when it is possible to try again.
-
- ssize_t n;
-
- if ((n = this->send_peer (mb)) == -1)
- return -1;
- else if (errno == EWOULDBLOCK) // Didn't manage to send everything.
- {
- ACE_DEBUG ((LM_DEBUG,
- "queueing activated on handle %d to routing id %d\n",
- this->get_handle (), this->routing_id_));
-
- // ACE_Queue in *front* of the list to preserve order.
- if (this->msg_queue ()->enqueue_head
- (mb, (ACE_Time_Value *) &ACE_Time_Value::zero) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "enqueue_head"), -1);
-
- // Tell ACE_Reactor to call us back when we can send again.
- if (ACE_Service_Config::reactor ()->schedule_wakeup
- (this, ACE_Event_Handler::WRITE_MASK) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "schedule_wakeup"), -1);
- return 0;
- }
- else
- return n;
-}
-
-// Finish sending a message when flow control conditions abate. This
-// method is automatically called by the ACE_Reactor.
-
-int
-Gateway_Handler::handle_output (ACE_HANDLE)
-{
- ACE_Message_Block *mb = 0;
-
- ACE_DEBUG ((LM_DEBUG, "in handle_output\n"));
- // The list had better not be empty, otherwise there's a bug!
-
- if (this->msg_queue ()->dequeue_head
- (mb, (ACE_Time_Value *) &ACE_Time_Value::zero) != -1)
- {
- switch (this->nonblk_put (mb))
- {
- case 0: // Partial send.
- ACE_ASSERT (errno == EWOULDBLOCK);
- // Didn't write everything this time, come back later...
- break;
-
- case -1:
- // Caller is responsible for freeing a ACE_Message_Block if
- // failures occur.
- delete mb;
- ACE_ERROR ((LM_ERROR, "%p\n",
- "transmission failure in handle_output"));
-
- /* FALLTHROUGH */
- default: // Sent the whole thing.
-
- // If we succeed in writing the entire message (or we did
- // not fail due to EWOULDBLOCK) then check if there are more
- // messages on the Message_List. If there aren't, tell the
- // ACE_Reactor not to notify us anymore (at least until
- // there are new messages queued up).
-
- if (this->msg_queue ()->is_empty ())
- {
- ACE_DEBUG ((LM_DEBUG,
- "queue now empty on handle %d to routing id %d\n",
- this->get_handle (),
- this->routing_id_));
-
- if (ACE_Service_Config::reactor ()->cancel_wakeup
- (this, ACE_Event_Handler::WRITE_MASK) == -1)
- ACE_ERROR ((LM_ERROR, "%p\n", "cancel_wakeup"));
- }
- }
- }
- else
- ACE_ERROR ((LM_ERROR, "%p\n", "dequeue_head"));
- return 0;
-}
-
-// Send a message to a peer (may ACE_Task if necessary).
-
-int
-Gateway_Handler::put (ACE_Message_Block *mb, ACE_Time_Value *)
-{
- if (this->msg_queue ()->is_empty ())
- // Try to send the message *without* blocking!
- return this->nonblk_put (mb);
- else
- // If we have queued up messages due to flow control then just
- // enqueue and return.
- return this->msg_queue ()->enqueue_tail
- (mb, (ACE_Time_Value *) &ACE_Time_Value::zero);
-}
-
-// Send an Peer message to gatewayd.
-
-int
-Gateway_Handler::send_peer (ACE_Message_Block *mb)
-{
- ssize_t n;
- size_t len = mb->length ();
-
- if ((n = this->peer ().send (mb->rd_ptr (), len)) <= 0)
- return errno == EWOULDBLOCK ? 0 : n;
- else if (n < (ssize_t) len)
- {
- // Re-adjust pointer to skip over the part we did send.
- mb->rd_ptr (n);
- this->total_bytes_ += n;
- }
- else /* if (n == length) */
- {
- // The whole message is sent, we can now safely deallocate the
- // buffer. Note that this should decrement a reference count...
- this->total_bytes_ += n;
- delete mb;
- errno = 0;
- }
- ACE_DEBUG ((LM_DEBUG, "sent %d bytes, total bytes sent = %d\n",
- n, this->total_bytes_));
- return n;
-}
-
-// Receive an Peer message from gatewayd. Handles fragmentation.
-
-int
-Gateway_Handler::recv_peer (ACE_Message_Block *&mb)
-{
- Event *peer_msg;
- size_t len;
- ssize_t n;
- size_t offset = 0;
-
- if (this->msg_frag_ == 0)
- {
- ACE_NEW_RETURN (this->msg_frag_,
- ACE_Message_Block (sizeof (Event)),
- -1);
-
- // No existing fragment...
- if (this->msg_frag_ == 0)
- ACE_ERROR_RETURN ((LM_ERROR, "out of memory\n"), -1);
-
- peer_msg = (Event *) this->msg_frag_->rd_ptr ();
-
- switch (n = this->peer ().recv (peer_msg, sizeof (Peer_Header)))
- {
- case sizeof (Peer_Header):
- len = ntohl (peer_msg->header_.len_);
- if (len <= sizeof peer_msg->buf_)
- {
- this->msg_frag_->wr_ptr (sizeof (Peer_Header));
- break; // The message is within the maximum size range.
- }
- else
- ACE_ERROR ((LM_ERROR, "message too long = %d\n", len));
- /* FALLTHROUGH */
- default:
- ACE_ERROR ((LM_ERROR, "invalid length = %d\n", n));
- n = -1;
- /* FALLTHROUGH */
- case -1:
- /* FALLTHROUGH */
- case 0:
- // Make sure to free up memory on error returns.
- delete this->msg_frag_;
- this->msg_frag_ = 0;
- return n;
- }
- }
- else
- {
- offset = this->msg_frag_->length () - sizeof (Peer_Header);
- len = peer_msg->header_.len_ - offset;
- }
-
- switch (n = this->peer ().recv (peer_msg->buf_ + offset, len))
- {
- case -1:
- if (errno == EWOULDBLOCK)
- {
- // This shouldn't happen since the ACE_Reactor
- // just triggered us to handle pending I/O!
- ACE_DEBUG ((LM_DEBUG, "unexpected recv failure\n"));
- // Since ACE_DEBUG might change errno, we need to reset it
- // here.
- errno = EWOULDBLOCK;
- return -1;
- }
- else
- /* FALLTHROUGH */;
-
- case 0: // EOF.
- delete this->msg_frag_;
- this->msg_frag_ = 0;
- return n;
-
- default:
- if (n != (ssize_t) len)
- // Re-adjust pointer to skip over the part we've read.
- {
- this->msg_frag_->wr_ptr (n);
- errno = EWOULDBLOCK;
- // Inform caller that we didn't get the whole message.
- return -1;
- }
- else
- {
- // Set the write pointer at 1 past the end of the message.
- this->msg_frag_->wr_ptr (n);
-
- // Set the read pointer to the beginning of the message.
- this->msg_frag_->rd_ptr (this->msg_frag_->base ());
-
- mb = this->msg_frag_;
-
- // Reset the pointer to indicate we've got an entire
- // message.
- this->msg_frag_ = 0;
- }
- return n;
- }
-}
-
-// Receive various types of input (e.g., Peer message from the
-// gatewayd, as well as stdio).
-
-int
-Gateway_Handler::handle_input (ACE_HANDLE sd)
-{
- ACE_DEBUG ((LM_DEBUG, "in handle_input, sd = %d\n", sd));
- if (sd == ACE_STDIN) // Handle message from stdin.
- return this->xmit_stdin ();
- else
- // Perform the appropriate action depending on the state we are
- // in.
- return (this->*do_action_) ();
-}
-
-// Action that receives the route id.
-
-int
-Gateway_Handler::await_route_id (void)
-{
- ssize_t n = this->peer ().recv (&this->routing_id_,
- sizeof this->routing_id_);
-
- if (n != sizeof this->routing_id_)
- {
- if (n == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "gatewayd has closed down unexpectedly\n"), -1);
- else
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p, bytes received on handle %d = %d\n",
- "recv", this->get_handle (), n), -1);
- }
- else
- ACE_DEBUG ((LM_DEBUG, "assigned routing id %d\n",
- this->routing_id_));
-
- // Transition to the action that waits for Peer messages.
- this->do_action_ = &Gateway_Handler::await_messages;
-
- // Reset standard input.
- ACE_OS::rewind (stdin);
-
- // Register this handler to receive test messages on stdin.
- if (ACE_Service_Config::reactor ()->register_handler
- (ACE_STDIN, this, ACE_Event_Handler::READ_MASK) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "register_handler"), -1);
- return 0;
-}
-
-// Action that receives messages.
-
-int
-Gateway_Handler::await_messages (void)
-{
- ACE_Message_Block *mb = 0;
- ssize_t n = this->recv_peer (mb);
-
- switch (n)
- {
- case 0:
- ACE_ERROR_RETURN ((LM_ERROR, "gatewayd has closed down\n"), -1);
- /* NOTREACHED */
- case -1:
- if (errno == EWOULDBLOCK)
- // A short-read, we'll come back and finish it up later on!
- return 0;
- else
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "recv_peer"), -1);
- /* NOTREACHED */
- default:
- {
- // We got a valid message, so let's process it now! At the
- // moment, we just print out the message contents...
-
- Event *peer_msg = (Event *) mb->rd_ptr ();
- this->total_bytes_ += mb->length ();
-
-#if defined (VERBOSE)
- ACE_DEBUG ((LM_DEBUG,
- "route id = %d, len = %d, payload = %*s",
- peer_msg->header_.routing_id_, peer_msg->header_.len_,
- peer_msg->header_.len_, peer_msg->buf_));
-#else
- ACE_DEBUG ((LM_DEBUG,
- "route id = %d, cur len = %d, total len = %d\n",
- peer_msg->header_.routing_id_,
- peer_msg->header_.len_,
- this->total_bytes_));
-#endif
- delete mb;
- return 0;
- }
- }
-}
-
-// Periodically send messages via ACE_Reactor timer mechanism.
-
-int
-Gateway_Handler::handle_timeout (const ACE_Time_Value &, const void *)
-{
- // Skip over deactivated descriptors.
- if (this->get_handle () != -1)
- {
- // Unbind ourselves from the map.
- if (this->map_->unbind (this->get_handle ()) == -1)
- ACE_ERROR ((LM_ERROR, "%p\n", "unbind"));
-
- // Shut down the handler.
- this->handle_close ();
- }
- return 0;
-}
-
-// Handle shutdown of the Gateway_Handler object.
-
-int
-Gateway_Handler::handle_close (ACE_HANDLE, ACE_Reactor_Mask)
-{
- if (this->get_handle () != ACE_INVALID_HANDLE)
- {
- ACE_DEBUG ((LM_DEBUG, "shutting down Gateway_Handler on handle %d\n",
- this->get_handle ()));
-
- // Explicitly remove ourselves for handle 0 (the ACE_Reactor
- // removes this->handle (), note that
- // ACE_Event_Handler::DONT_CALL instructs the ACE_Reactor *not*
- // to call this->handle_close(), which would otherwise lead to
- // recursion!).
- if (ACE_Service_Config::reactor ()->remove_handler
- (0, ACE_Event_Handler::DONT_CALL | ACE_Event_Handler::READ_MASK) == -1)
- ACE_ERROR ((LM_ERROR, "handle = %d: %p\n",
- 0, "remove_handler"));
-
- // Deregister this handler with the ACE_Reactor.
- if (ACE_Service_Config::reactor ()->remove_handler
- (this, ACE_Event_Handler::DONT_CALL | ACE_Event_Handler::RWE_MASK) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "handle = %d: %p\n",
- this->get_handle (), "remove_handler"), -1);
-
- // Close down the peer.
- this->peer ().close ();
- }
- return 0;
-}
-
-Gateway_Acceptor::Gateway_Acceptor (Gateway_Handler *handler)
- : gateway_handler_ (handler)
-{
- this->gateway_handler_->map (&this->map_);
-}
-
-// Note how this method just passes back the pre-allocated
-// Gateway_Handler instead of having the ACE_Acceptor allocate a new
-// one each time!
-
-Gateway_Handler *
-Gateway_Acceptor::make_svc_handler (void)
-{
- return this->gateway_handler_;
-}
-
-int
-Gateway_Acceptor::handle_signal (int signum, siginfo_t *, ucontext_t *)
-{
- ACE_DEBUG ((LM_DEBUG, "signal %S occurred\n", signum));
- return 0;
-}
-
-/* Returns information on the currently active service. */
-
-int
-Gateway_Acceptor::info (char **strp, size_t length) const
-{
- char buf[BUFSIZ];
- char addr_str[BUFSIZ];
-
- ACE_INET_Addr addr;
-
- if (this->acceptor ().get_local_addr (addr) == -1)
- return -1;
- else if (addr.addr_to_string (addr_str, sizeof addr) == -1)
- return -1;
-
- ACE_OS::sprintf (buf, "%s\t %s/%s %s",
- "Gateway peer daemon", addr_str, "tcp",
- "# IRIDIUM SRP traffic generator and data sink\n");
-
- if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0)
- return -1;
- else
- ACE_OS::strncpy (*strp, buf, length);
- return ACE_OS::strlen (buf);
-}
-
-// Hook called by the explicit dynamic linking facility to terminate
-// the peer.
-
-int
-Gateway_Acceptor::fini (void)
-{
- HANDLER_ITERATOR mi (this->map_);
-
- for (MAP_ENTRY *me = 0;
- mi.next (me) != 0;
- mi.advance ())
- {
- if (me->int_id_->get_handle () != -1)
- {
- ACE_DEBUG ((LM_DEBUG, "closing down handle %d\n",
- me->int_id_->get_handle ()));
- me->int_id_->handle_close ();
- }
- else
- ACE_DEBUG ((LM_DEBUG, "already closed %d\n"));
- me->int_id_->destroy (); // Will trigger a delete.
- }
-
- this->gateway_handler_->destroy (); // Will trigger a delete.
- return inherited::fini ();
-}
-
-// Hook called by the explicit dynamic linking facility to initialize
-// the peer.
-
-int
-Gateway_Acceptor::init (int argc, char *argv[])
-{
- ACE_Get_Opt get_opt (argc, argv, "dp:", 0);
- ACE_INET_Addr addr;
-
- for (int c; (c = get_opt ()) != -1; )
- {
- switch (c)
- {
- case 'p':
- addr.set (ACE_OS::atoi (get_opt.optarg));
- break;
- case 'd':
- break;
- default:
- break;
- }
- }
-
- if (ACE_Service_Config::reactor ()->register_handler (SIGPIPE, this) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "register_handler"), -1);
-
- if (this->open (addr) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), -1);
- else if (ACE_Service_Config::reactor ()->register_handler
- (this, ACE_Event_Handler::READ_MASK) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "registering service with ACE_Reactor\n"), -1);
-
- ACE_Sig_Set sig_set;
- sig_set.sig_add (SIGINT);
- sig_set.sig_add (SIGQUIT);
-
- // Register ourselves to receive SIGINT and SIGQUIT so we can shut
- // down gracefully via signals.
-
- if (ACE_Service_Config::reactor ()->register_handler (sig_set,
- this) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "(%t) %p\n", "register_handler"), -1);
- return 0;
-}
-
-// Dynamically linked factory function that dynamically allocates a
-// new Gateway_Acceptor object.
-
-ACE_Service_Object *
-_alloc_peerd (void)
-{
- // This function illustrates how we can associate a ACE_Svc_Handler
- // with the ACE_Acceptor at initialization time.
- Gateway_Handler *handler;
-
- ACE_NEW_RETURN (handler, Gateway_Handler, 0);
- ACE_Service_Object *temp;
-
- ACE_NEW_RETURN (temp, Gateway_Acceptor (handler), 0);
- return temp;
-}
diff --git a/apps/Gateway/Peer/Gateway_Handler.h b/apps/Gateway/Peer/Gateway_Handler.h
deleted file mode 100644
index 6dc4539e6b7..00000000000
--- a/apps/Gateway/Peer/Gateway_Handler.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/* -*- C++ -*- */
-// $Id$
-
-
-/* These Gateway handler classes process Peer messages sent from the
- communication gateway daemon (gatewayd) to its various peers, e.g.,
- CF and ETS, (represented collectively in this prototype as peerd).
- . These classes works as follows:
-
- 1. Gateway_Acceptor creates a listener endpoint and waits passively
- for gatewayd to connect with it.
-
- 2. When gatewayd connects, Gateway_Acceptor creates an
- Gateway_Handler object that sends/receives messages from
- gatewayd.
-
- 3. Gateway_Handler waits for gatewayd to inform it of its routing
- ID, which is prepended to all outgoing messages send from peerd.
-
- 4. Once the routing ID is set, peerd periodically sends messages to
- gatewayd. Peerd also receives and "processes" messages
- forwarded to it from gatewayd. In this program, peerd
- "processes" messages by writing them to stdout. */
-
-#if !defined (GATEWAY_HANDLER)
-#define GATEWAY_HANDLER
-
-#include "ace/Service_Config.h"
-#include "ace/Svc_Handler.h"
-#include "ace/Acceptor.h"
-#include "ace/SOCK_Stream.h"
-#include "ace/SOCK_Acceptor.h"
-#include "ace/INET_Addr.h"
-#include "ace/Map_Manager.h"
-#include "Peer_Message.h"
-
-// Forward declaration.
-class Gateway_Handler;
-
-// Maps a ACE_HANDLE onto a Gateway_Handler *.
-typedef ACE_Map_Manager <ACE_HANDLE, Gateway_Handler *, ACE_Null_Mutex> HANDLER_MAP;
-typedef ACE_Map_Iterator<ACE_HANDLE, Gateway_Handler *, ACE_Null_Mutex> HANDLER_ITERATOR;
-typedef ACE_Map_Entry <ACE_HANDLE, Gateway_Handler *> MAP_ENTRY;
-
-// Handle Peer messages arriving as events.
-
-class Gateway_Handler : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
-{
-public:
- Gateway_Handler (ACE_Thread_Manager * = 0);
-
- virtual int open (void * = 0);
- // Initialize the handler (called by ACE_Acceptor::handle_input())
-
- virtual int handle_input (ACE_HANDLE);
- // Receive and process peer messages.
-
- virtual int put (ACE_Message_Block *, ACE_Time_Value *tv = 0);
- // Send a message to a gateway (may be queued if necessary).
-
- virtual int handle_output (ACE_HANDLE);
- // Finish sending a message when flow control conditions abate.
-
- virtual int handle_timeout (const ACE_Time_Value &,
- const void *arg);
- // Periodically send messages via ACE_Reactor timer mechanism.
-
- virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE,
- ACE_Reactor_Mask = ACE_Event_Handler::RWE_MASK);
- // Perform object termination.
-
- void map (HANDLER_MAP *);
- // Cache a binding to the HANDLER_MAP.
-
-protected:
- typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> inherited;
-
- // We'll allow up to 16 megabytes to be queued per-output
- // channel!!!! This is clearly a policy in search of refinement...
- enum { QUEUE_SIZE = 1024 * 1024 * 16 };
-
- int handle_signal (int signum, siginfo_t *, ucontext_t *);
-
- Peer_Header::ROUTING_ID routing_id_;
- // Routing ID of the peer (obtained from gatewayd).
-
- virtual int nonblk_put (ACE_Message_Block *mb);
- // Perform a non-blocking put().
-
- virtual int recv_peer (ACE_Message_Block *&);
- // Receive an Peer message from gatewayd.
-
- virtual int send_peer (ACE_Message_Block *);
- // Send an Peer message to gatewayd.
-
- int xmit_stdin (void);
- // Receive a message from stdin and send it to the gateway.
-
- int (Gateway_Handler::*do_action_) (void);
- // Pointer-to-member-function for the current action to run in this state.
-
- int await_route_id (void);
- // Action that receives the route id.
-
- int await_messages (void);
- // Action that receives messages.
-
- ACE_Message_Block *msg_frag_;
- // Keep track of message fragment to handle non-blocking recv's from gateway.
-
- size_t total_bytes_;
- // The total number of bytes sent/received to the gateway.
-
- HANDLER_MAP *map_;
- // Maps the ACE_HANDLE onto the Gateway_Handler *.
-};
-
-// A factory class that accept connections from gatewayd and
-// dynamically creates a new Gateway_Handler object to do the dirty work.
-
-class Gateway_Acceptor : public ACE_Acceptor<Gateway_Handler, ACE_SOCK_ACCEPTOR>
-{
-public:
- // = Initialization methods, called when dynamically linked.
- Gateway_Acceptor (Gateway_Handler *handler);
- virtual int init (int argc, char *argv[]);
- // Initialize the acceptor.
-
- virtual int info (char **, size_t) const;
- // Return info about this service.
-
- virtual int fini (void);
- // Perform termination.
-
- virtual Gateway_Handler *make_svc_handler (void);
- // Factory method that creates the Gateway_Handler once.
-
- virtual int handle_signal (int signum, siginfo_t *, ucontext_t *);
- // Handle various signals (e.g., SIGPIPE)
-
- HANDLER_MAP map_;
- // Maps the ACE_HANDLE onto the Gateway_Handler *.
-
- Gateway_Handler *gateway_handler_;
- // Pointer to memory allocated exactly once.
-
- typedef ACE_Acceptor<Gateway_Handler, ACE_SOCK_ACCEPTOR> inherited;
-};
-
-// Factory function that allocates a new Peer daemon.
-extern "C" ACE_Service_Object *_alloc_peerd (void);
-
-#endif /* GATEWAY_HANDLER */
-
diff --git a/apps/Gateway/Peer/Makefile b/apps/Gateway/Peer/Makefile
deleted file mode 100644
index d70a2949550..00000000000
--- a/apps/Gateway/Peer/Makefile
+++ /dev/null
@@ -1,136 +0,0 @@
-#----------------------------------------------------------------------------
-# @(#)Makefile 1.1 10/18/96
-#
-# Makefile for the Peer test driver portion of the Gateway application
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-BIN = peerd
-LIB = libPeer.a
-SHLIB = libPeer.$(SOEXT)
-
-FILES = Options \
- Peer
-
-LSRC = $(addsuffix .cpp,$(FILES))
-LDLIBS = -lPeer
-VLDLIBS = $(LDLIBS:%=%$(VAR))
-
-BUILD = $(VLIB) $(VSHLIB) $(SHLIBA) $(VBIN)
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
-
-#----------------------------------------------------------------------------
-# Local targets
-#----------------------------------------------------------------------------
-
-INCLDIRS += -I../Gateway
-
-#----------------------------------------------------------------------------
-# Dependencies
-#----------------------------------------------------------------------------
-
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
-# DO NOT DELETE THIS LINE -- g++dep uses it.
-# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-
-.obj/Options.o .obj/Options.so .shobj/Options.o .shobj/Options.so: Options.cpp $(ACE_ROOT)/ace/Get_Opt.h \
- $(ACE_ROOT)/ace/ACE.h \
- $(ACE_ROOT)/ace/OS.h \
- $(ACE_ROOT)/ace/inc_user_config.h \
- $(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/streams.h \
- $(ACE_ROOT)/ace/Basic_Types.h \
- $(ACE_ROOT)/ace/Trace.h \
- $(ACE_ROOT)/ace/Log_Msg.h \
- $(ACE_ROOT)/ace/Log_Record.h \
- $(ACE_ROOT)/ace/Log_Priority.h \
- $(ACE_ROOT)/ace/Log_Record.i \
- $(ACE_ROOT)/ace/Version.h \
- $(ACE_ROOT)/ace/ACE.i Options.h \
- ../Gateway/Event.h
-.obj/Peer.o .obj/Peer.so .shobj/Peer.o .shobj/Peer.so: Peer.cpp Peer.h \
- $(ACE_ROOT)/ace/Service_Config.h \
- $(ACE_ROOT)/ace/Service_Object.h \
- $(ACE_ROOT)/ace/Shared_Object.h \
- $(ACE_ROOT)/ace/ACE.h \
- $(ACE_ROOT)/ace/OS.h \
- $(ACE_ROOT)/ace/inc_user_config.h \
- $(ACE_ROOT)/ace/config.h \
- $(ACE_ROOT)/ace/streams.h \
- $(ACE_ROOT)/ace/Basic_Types.h \
- $(ACE_ROOT)/ace/Trace.h \
- $(ACE_ROOT)/ace/Log_Msg.h \
- $(ACE_ROOT)/ace/Log_Record.h \
- $(ACE_ROOT)/ace/Log_Priority.h \
- $(ACE_ROOT)/ace/Log_Record.i \
- $(ACE_ROOT)/ace/Version.h \
- $(ACE_ROOT)/ace/ACE.i \
- $(ACE_ROOT)/ace/Event_Handler.h \
- $(ACE_ROOT)/ace/Signal.h \
- $(ACE_ROOT)/ace/Synch.h \
- $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \
- $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \
- $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \
- $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \
- $(ACE_ROOT)/ace/Synch_T.h \
- $(ACE_ROOT)/ace/Containers.h \
- $(ACE_ROOT)/ace/Reactor.h \
- $(ACE_ROOT)/ace/Handle_Set.h \
- $(ACE_ROOT)/ace/Timer_Queue.h \
- $(ACE_ROOT)/ace/Timer_Queue_T.h \
- $(ACE_ROOT)/ace/Free_List.h \
- $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \
- $(ACE_ROOT)/ace/Acceptor.h \
- $(ACE_ROOT)/ace/Svc_Handler.h \
- $(ACE_ROOT)/ace/Synch_Options.h \
- $(ACE_ROOT)/ace/Task.h \
- $(ACE_ROOT)/ace/Thread_Manager.h \
- $(ACE_ROOT)/ace/Thread.h \
- $(ACE_ROOT)/ace/Task_T.h \
- $(ACE_ROOT)/ace/Message_Queue.h \
- $(ACE_ROOT)/ace/Message_Block.h \
- $(ACE_ROOT)/ace/Malloc.h \
- $(ACE_ROOT)/ace/Malloc_T.h \
- $(ACE_ROOT)/ace/Memory_Pool.h \
- $(ACE_ROOT)/ace/Mem_Map.h \
- $(ACE_ROOT)/ace/IO_Cntl_Msg.h \
- $(ACE_ROOT)/ace/Strategies.h \
- $(ACE_ROOT)/ace/Strategies_T.h \
- $(ACE_ROOT)/ace/Hash_Map_Manager.h \
- $(ACE_ROOT)/ace/Dynamic.h \
- $(ACE_ROOT)/ace/Singleton.h \
- $(ACE_ROOT)/ace/Acceptor.i \
- $(ACE_ROOT)/ace/Connector.h \
- $(ACE_ROOT)/ace/Map_Manager.h \
- $(ACE_ROOT)/ace/Connector.i \
- $(ACE_ROOT)/ace/SOCK_Acceptor.h \
- $(ACE_ROOT)/ace/SOCK_Stream.h \
- $(ACE_ROOT)/ace/SOCK_IO.h \
- $(ACE_ROOT)/ace/SOCK.h \
- $(ACE_ROOT)/ace/Addr.h \
- $(ACE_ROOT)/ace/IPC_SAP.h \
- $(ACE_ROOT)/ace/IPC_SAP.i \
- $(ACE_ROOT)/ace/SOCK.i \
- $(ACE_ROOT)/ace/SOCK_IO.i \
- $(ACE_ROOT)/ace/INET_Addr.h \
- $(ACE_ROOT)/ace/SOCK_Stream.i \
- $(ACE_ROOT)/ace/Time_Value.h \
- $(ACE_ROOT)/ace/SOCK_Connector.h \
- $(ACE_ROOT)/ace/SOCK_Connector.i Options.h \
- ../Gateway/Event.h
-
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/apps/Gateway/Peer/Options.cpp b/apps/Gateway/Peer/Options.cpp
deleted file mode 100644
index f3fe8f119dd..00000000000
--- a/apps/Gateway/Peer/Options.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-#define ACE_BUILD_SVC_DLL
-
-#include "ace/Get_Opt.h"
-#include "Options.h"
-
-// Static initialization.
-Options *Options::instance_ = 0;
-
-void
-Options::print_usage_and_die (void)
-{
- ACE_DEBUG ((LM_DEBUG, "%n [-a {C|S}:acceptor-port] [-c {C|S}:connector-port] [-C connection-id] [-h gateway-host] [-q max-queue-size] [-t timeout] [-v]\n"));
-}
-
-Options::Options (void)
- : options_ (0),
- supplier_acceptor_port_ (DEFAULT_PEER_SUPPLIER_PORT),
- consumer_acceptor_port_ (DEFAULT_PEER_CONSUMER_PORT),
- supplier_connector_port_ (DEFAULT_GATEWAY_SUPPLIER_PORT),
- consumer_connector_port_ (DEFAULT_GATEWAY_CONSUMER_PORT),
- connector_host_ (ACE_DEFAULT_SERVER_HOST),
- timeout_ (0),
- max_queue_size_ (MAX_QUEUE_SIZE),
- connection_id_ (0)
-{
- char *timeout = ACE_OS::getenv ("TIMEOUT");
-
- if (timeout == 0)
- this->timeout_ = Options::DEFAULT_TIMEOUT;
- else
- this->timeout_ = ACE_OS::atoi (timeout);
-}
-
-Options *
-Options::instance (void)
-{
- if (Options::instance_ == 0)
- ACE_NEW_RETURN (Options::instance_, Options, 0);
-
- return Options::instance_;
-}
-
-long
-Options::timeout (void) const
-{
- return this->timeout_;
-}
-
-CONNECTION_ID &
-Options::connection_id (void)
-{
- return this->connection_id_;
-}
-
-long
-Options::max_queue_size (void) const
-{
- return this->max_queue_size_;
-}
-
-u_short
-Options::consumer_acceptor_port (void) const
-{
- return this->consumer_acceptor_port_;
-}
-
-u_short
-Options::supplier_acceptor_port (void) const
-{
- return this->supplier_acceptor_port_;
-}
-
-u_short
-Options::consumer_connector_port (void) const
-{
- return this->consumer_connector_port_;
-}
-
-u_short
-Options::supplier_connector_port (void) const
-{
- return this->supplier_connector_port_;
-}
-
-const char *
-Options::connector_host (void) const
-{
- return this->connector_host_;
-}
-
-int
-Options::enabled (int option) const
-{
- return ACE_BIT_ENABLED (this->options_, option);
-}
-
-void
-Options::parse_args (int argc, char *argv[])
-{
- ACE_Get_Opt get_opt (argc, argv, "a:c:h:m:t:v", 0);
-
- for (int c; (c = get_opt ()) != -1; )
- {
- switch (c)
- {
- case 'a':
- {
- // Become an Acceptor.
-
- for (char *flag = ACE_OS::strtok (get_opt.optarg, "|");
- flag != 0;
- flag = ACE_OS::strtok (0, "|"))
- if (ACE_OS::strncasecmp (flag, "C", 1) == 0)
- {
- ACE_SET_BITS (this->options_,
- Options::CONSUMER_ACCEPTOR);
- if (ACE_OS::strlen (flag) > 1)
- // Set the Consumer Acceptor port number.
- this->consumer_acceptor_port_ = ACE_OS::atoi (flag + 2);
- }
- else if (ACE_OS::strncasecmp (flag, "S", 1) == 0)
- {
- ACE_SET_BITS (this->options_,
- Options::SUPPLIER_ACCEPTOR);
- if (ACE_OS::strlen (flag) > 1)
- // Set the Supplier Acceptor port number.
- this->supplier_acceptor_port_ = ACE_OS::atoi (flag + 2);
- }
- }
- break;
- /* NOTREACHED */
- case 'c':
- {
- // Become a Connector.
-
- for (char *flag = ACE_OS::strtok (get_opt.optarg, "|");
- flag != 0;
- flag = ACE_OS::strtok (0, "|"))
- if (ACE_OS::strncasecmp (flag, "C", 1) == 0)
- {
- ACE_SET_BITS (this->options_,
- Options::CONSUMER_CONNECTOR);
- if (ACE_OS::strlen (flag) > 1)
- // Set the Consumer Connector port number.
- this->consumer_connector_port_ = ACE_OS::atoi (flag + 2);
- }
- else if (ACE_OS::strncasecmp (flag, "S", 1) == 0)
- {
- ACE_SET_BITS (this->options_,
- Options::SUPPLIER_CONNECTOR);
- if (ACE_OS::strlen (flag) > 1)
- // Set the Supplier Connector port number.
- this->supplier_connector_port_ = ACE_OS::atoi (flag + 2);
- }
- }
- break;
- /* NOTREACHED */
- case 'C':
- this->connection_id_ = ACE_OS::atoi (get_opt.optarg);
- break;
- /* NOTREACHED */
- case 'h':
- // connector host
- this->connector_host_ = get_opt.optarg;
- break;
- /* NOTREACHED */
- case 'm':
- // max queue size.
- this->max_queue_size_ = ACE_OS::atoi (get_opt.optarg);
- break;
- /* NOTREACHED */
- case 't':
- // Timeout
- this->timeout_ = ACE_OS::atoi (get_opt.optarg);
- break;
- /* NOTREACHED */
- case 'v':
- // Verbose mode.
- ACE_SET_BITS (this->options_, Options::VERBOSE);
- break;
- /* NOTREACHED */
- default:
- this->print_usage_and_die ();
- /* NOTREACHED */
- }
- }
-}
-
diff --git a/apps/Gateway/Peer/Options.h b/apps/Gateway/Peer/Options.h
deleted file mode 100644
index c957e1a295e..00000000000
--- a/apps/Gateway/Peer/Options.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/* -*- C++ -*- */
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// gateway
-//
-// = FILENAME
-// Options.h
-//
-// = AUTHOR
-// Douglas C. Schmidt
-//
-// ============================================================================
-
-#if !defined (OPTIONS_H)
-#define OPTIONS_H
-
-#include "../Gateway/Event.h"
-
-class ACE_Svc_Export Options
- // = TITLE
- // Singleton that consolidates all Options for a peerd.
-{
-public:
- // = Options that can be enabled/disabled.
- enum
- {
- VERBOSE = 01,
- SUPPLIER_ACCEPTOR = 02,
- CONSUMER_ACCEPTOR = 04,
- SUPPLIER_CONNECTOR = 010,
- CONSUMER_CONNECTOR = 020
- };
-
- static Options *instance (void);
- // Return Singleton.
-
- void parse_args (int argc, char *argv[]);
- // Parse the arguments and set the options.
-
- // = Accessor methods.
- int enabled (int option) const;
- // Determine if an option is enabled.
-
- u_short supplier_acceptor_port (void) const;
- // Our acceptor port number, i.e., the one that we passively listen
- // on for connections to arrive from a gatewayd and create a
- // Supplier.
-
- u_short consumer_acceptor_port (void) const;
- // Our acceptor port number, i.e., the one that we passively listen
- // on for connections to arrive from a gatewayd and create a
- // Consumer.
-
- u_short supplier_connector_port (void) const;
- // The connector port number, i.e., the one that we use to actively
- // establish connections with a gatewayd and create a Supplier.
-
- u_short consumer_connector_port (void) const;
- // The connector port number, i.e., the one that we use to actively
- // establish connections with a gatewayd and create a Consumer.
-
- const char *connector_host (void) const;
- // Our connector port host, i.e., the host running the gatewayd
- // process.
-
- long timeout (void) const;
- // Duration between disconnects.
-
- long max_queue_size (void) const;
- // The maximum size of the queue.
-
- CONNECTION_ID &connection_id (void);
- // Returns a reference to the connection id.
-
-private:
- enum
- {
- MAX_QUEUE_SIZE = 1024 * 1024 * 16,
- // We'll allow up to 16 megabytes to be queued per-output
- // channel!!!! This is clearly a policy in search of
- // refinement...
-
- DEFAULT_TIMEOUT = 60
- // By default, disconnect the peer every minute.
- };
-
- Options (void);
- // Ensure Singleton.
-
- void print_usage_and_die (void);
- // Explain usage and exit.
-
- static Options *instance_;
- // Singleton.
-
- u_long options_;
- // Flag to indicate if we want verbose diagnostics.
-
- u_short supplier_acceptor_port_;
- // The acceptor port number, i.e., the one that we passively listen
- // on for connections to arrive from a gatewayd and create a
- // Supplier.
-
- u_short consumer_acceptor_port_;
- // The acceptor port number, i.e., the one that we passively listen
- // on for connections to arrive from a gatewayd and create a
- // Consumer.
-
- u_short supplier_connector_port_;
- // The connector port number, i.e., the one that we use to actively
- // establish connections with a gatewayd and create a Supplier.
-
- u_short consumer_connector_port_;
- // The connector port number, i.e., the one that we use to actively
- // establish connections with a gatewayd and create a Consumer.
-
- char *connector_host_;
- // Our connector host, i.e., where the gatewayd process is running.
-
- long timeout_;
- // The amount of time to wait before disconnecting from the Peerd.
-
- long max_queue_size_;
- // The maximum size that the queue can grow to.
-
- CONNECTION_ID connection_id_;
- // The connection id.
-};
-
-#endif /* OPTIONS_H */
diff --git a/apps/Gateway/Peer/Peer.cpp b/apps/Gateway/Peer/Peer.cpp
deleted file mode 100644
index 134f7b8f7e8..00000000000
--- a/apps/Gateway/Peer/Peer.cpp
+++ /dev/null
@@ -1,844 +0,0 @@
-// $Id$
-
-#define ACE_BUILD_SVC_DLL
-
-#include "Peer.h"
-
-Peer_Handler::Peer_Handler (void)
- : connection_id_ (0),
- msg_frag_ (0),
- total_bytes_ (0)
-{
- // Set the high water mark of the <ACE_Message_Queue>. This is used
- // to exert flow control.
- this->msg_queue ()->high_water_mark (Options::instance ()->max_queue_size ());
-}
-
-// Upcall from the <ACE_Acceptor::handle_input> that turns control
-// over to our application-specific Gateway handler.
-
-int
-Peer_Handler::open (void *a)
-{
- ACE_DEBUG ((LM_DEBUG,
- "handle = %d\n",
- this->peer ().get_handle ()));
-
- // Call down to the base class to activate and register this handler
- // with an <ACE_Reactor>.
- if (this->inherited::open (a) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), -1);
-
- if (this->peer ().enable (ACE_NONBLOCK) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "enable"), -1);
-
- ACE_Time_Value timeout (Options::instance ()->timeout ());
-
- // Schedule the time between disconnects. This should really be a
- // "tunable" parameter.
- if (ACE_Reactor::instance ()->schedule_timer
- (this, 0, timeout) == -1)
- ACE_ERROR ((LM_ERROR,
- "%p\n",
- "schedule_timer"));
-
- // If there are events left in the queue, make sure we enable the
- // <ACE_Reactor> appropriately to get them sent out.
- if (this->msg_queue ()->is_empty () == 0
- && ACE_Reactor::instance ()->schedule_wakeup
- (this, ACE_Event_Handler::WRITE_MASK) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "schedule_wakeup"),
- -1);
-
- // First action is to wait to be notified of our connection id.
- this->do_action_ = &Peer_Handler::await_connection_id;
- return 0;
-}
-
-int
-Peer_Handler::transmit (ACE_Message_Block *mb,
- size_t n,
- int event_type)
-{
- Event *event = (Event *) mb->rd_ptr ();
-
- // Initialize the header.
- new (&event->header_) Event_Header (n,
- this->connection_id_,
- 0,
- event_type);
-
- // Convert all the fields into network byte order.
- event->header_.encode ();
-
- // Move the write pointer to the end of the event.
- mb->wr_ptr (sizeof (Event_Header) + n);
-
- if (this->put (mb) == -1)
- {
- if (errno == EWOULDBLOCK) // The queue has filled up!
- ACE_ERROR ((LM_ERROR,
- "%p\n",
- "gateway is flow controlled, so we're dropping events"));
- else
- ACE_ERROR ((LM_ERROR,
- "%p\n",
- "transmission failure in transmit_stdin"));
- // Caller is responsible for freeing a ACE_Message_Block
- // if failures occur.
- mb->release ();
- return -1;
- }
- return 0;
-}
-
-// Read events from stdin and send them to the gatewayd.
-
-int
-Peer_Handler::transmit_stdin (void)
-{
- if (this->connection_id_ != -1)
- {
- ACE_Message_Block *mb;
-
- ACE_NEW_RETURN (mb,
- ACE_Message_Block (sizeof (Event)),
- -1);
-
- // Cast the message block payload into an <Event> pointer.
- Event *event = (Event *) mb->rd_ptr ();
-
- ssize_t n = ACE_OS::read (ACE_STDIN,
- event->data_,
- sizeof event->data_);
- switch (n)
- {
- case 0:
- ACE_DEBUG ((LM_DEBUG, "stdin closing down\n"));
-
- // Take stdin out of the ACE_Reactor so we stop trying to
- // send events.
- ACE_Reactor::instance ()->remove_handler
- (ACE_STDIN,
- ACE_Event_Handler::DONT_CALL | ACE_Event_Handler::READ_MASK);
- mb->release ();
- break;
- /* NOTREACHED */
- case -1:
- mb->release ();
- ACE_ERROR ((LM_ERROR, "%p\n", "read"));
- break;
- /* NOTREACHED */
- default:
- return this->transmit (mb, n, ROUTING_EVENT);
- /* NOTREACHED */
- }
- return 0;
- }
-
- ACE_DEBUG ((LM_DEBUG, "Must transmit over an opened channel.\n"));
- return -1;
-}
-
-// Perform a non-blocking <put> of event MB. If we are unable to send
-// the entire event the remainder is re-queue'd at the *front* of the
-// Message_Queue.
-
-int
-Peer_Handler::nonblk_put (ACE_Message_Block *mb)
-{
- // Try to send the event. If we don't send it all (e.g., due to
- // flow control), then re-queue the remainder at the head of the
- // <ACE_Message_Queue> and ask the <ACE_Reactor> to inform us (via
- // <handle_output>) when it is possible to try again.
-
- ssize_t n = this->send (mb);
-
- if (n == -1)
- return -1;
- else if (errno == EWOULDBLOCK)
- {
- // We didn't manage to send everything, so requeue.
- ACE_DEBUG ((LM_DEBUG,
- "queueing activated on handle %d to connection id %d\n",
- this->get_handle (),
- this->connection_id_));
-
- // Re-queue in *front* of the list to preserve order.
- if (this->msg_queue ()->enqueue_head
- (mb,
- (ACE_Time_Value *) &ACE_Time_Value::zero) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "enqueue_head"),
- -1);
- // Tell ACE_Reactor to call us back when we can send again.
- if (ACE_Reactor::instance ()->schedule_wakeup
- (this, ACE_Event_Handler::WRITE_MASK) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "schedule_wakeup"),
- -1);
- return 0;
- }
- else
- return n;
-}
-
-// Finish sending a event when flow control conditions abate. This
-// method is automatically called by the ACE_Reactor.
-
-int
-Peer_Handler::handle_output (ACE_HANDLE)
-{
- ACE_Message_Block *mb = 0;
-
- ACE_DEBUG ((LM_DEBUG, "in handle_output\n"));
-
- if (this->msg_queue ()->dequeue_head
- (mb, (ACE_Time_Value *) &ACE_Time_Value::zero) != -1)
- {
- switch (this->nonblk_put (mb))
- {
- case 0: // Partial send.
- ACE_ASSERT (errno == EWOULDBLOCK);
- // Didn't write everything this time, come back later...
- break;
- /* NOTREACHED */
- case -1:
- // Caller is responsible for freeing a ACE_Message_Block if
- // failures occur.
- mb->release ();
- ACE_ERROR ((LM_ERROR,
- "%p\n",
- "transmission failure in handle_output"));
- /* FALLTHROUGH */
- default: // Sent the whole thing.
- // If we succeed in writing the entire event (or we did not
- // fail due to EWOULDBLOCK) then check if there are more
- // events on the <ACE_Message_Queue>. If there aren't, tell
- // the <ACE_Reactor> not to notify us anymore (at least
- // until there are new events queued up).
-
- if (this->msg_queue ()->is_empty ())
- {
- ACE_DEBUG ((LM_DEBUG,
- "queue now empty on handle %d to connection id %d\n",
- this->get_handle (),
- this->connection_id_));
-
- if (ACE_Reactor::instance ()->cancel_wakeup
- (this, ACE_Event_Handler::WRITE_MASK) == -1)
- ACE_ERROR ((LM_ERROR,
- "%p\n",
- "cancel_wakeup"));
- }
- }
- return 0;
- }
- else
- // If the list is empty there's a bug!
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "dequeue_head"),
- 0);
-}
-
-// Send an event to a peer (may block if necessary).
-
-int
-Peer_Handler::put (ACE_Message_Block *mb, ACE_Time_Value *)
-{
- if (this->msg_queue ()->is_empty ())
- // Try to send the event *without* blocking!
- return this->nonblk_put (mb);
- else
- // If we have queued up events due to flow control then just
- // enqueue and return.
- return this->msg_queue ()->enqueue_tail
- (mb, (ACE_Time_Value *) &ACE_Time_Value::zero);
-}
-
-// Send an Peer event to gatewayd.
-
-int
-Peer_Handler::send (ACE_Message_Block *mb)
-{
- size_t len = mb->length ();
-
- ssize_t n = this->peer ().send (mb->rd_ptr (), len);
-
- if (n <= 0)
- return errno == EWOULDBLOCK ? 0 : n;
- else if (n < (ssize_t) len)
- {
- // Re-adjust pointer to skip over the part we did send.
- mb->rd_ptr (n);
- this->total_bytes_ += n;
- }
- else // if (n == length).
- {
- // The whole event is sent, we can now safely deallocate the
- // buffer. Note that this should decrement a reference count...
- this->total_bytes_ += n;
- mb->release ();
- errno = 0;
- }
-
- ACE_DEBUG ((LM_DEBUG, "sent %d bytes, total bytes sent = %d\n",
- n, this->total_bytes_));
- return n;
-}
-
-// Receive an Event from gatewayd. Handles fragmentation.
-
-int
-Peer_Handler::recv (ACE_Message_Block *&mb)
-{
- if (this->msg_frag_ == 0)
- // No existing fragment...
- ACE_NEW_RETURN (this->msg_frag_,
- ACE_Message_Block (sizeof (Event)),
- -1);
-
- Event *event = (Event *) this->msg_frag_->rd_ptr ();
- ssize_t header_received = 0;
-
- const size_t HEADER_SIZE = sizeof (Event_Header);
- ssize_t header_bytes_left_to_read =
- HEADER_SIZE - this->msg_frag_->length ();
-
- if (header_bytes_left_to_read > 0)
- {
- header_received = this->peer ().recv
- (this->msg_frag_->wr_ptr (),
- header_bytes_left_to_read);
-
- if (header_received == -1 /* error */
- || header_received == 0 /* EOF */)
- {
- ACE_ERROR ((LM_ERROR,
- "%p\n",
- "Recv error during header read"));
- ACE_DEBUG ((LM_DEBUG,
- "attempted to read %d bytes\n",
- header_bytes_left_to_read));
- this->msg_frag_ = this->msg_frag_->release ();
- return header_received;
- }
-
- // Bump the write pointer by the amount read.
- this->msg_frag_->wr_ptr (header_received);
-
- // At this point we may or may not have the ENTIRE header.
- if (this->msg_frag_->length () < HEADER_SIZE)
- {
- ACE_DEBUG ((LM_DEBUG,
- "Partial header received: only %d bytes\n",
- this->msg_frag_->length ()));
- // Notify the caller that we didn't get an entire event.
- errno = EWOULDBLOCK;
- return -1;
- }
-
- // Convert the header into host byte order so that we can access
- // it directly without having to repeatedly muck with it...
- event->header_.decode ();
-
- if (event->header_.len_ > ACE_INT32 (sizeof event->data_))
- {
- // This data_ payload is too big!
- errno = EINVAL;
- ACE_DEBUG ((LM_DEBUG,
- "Data payload is too big (%d bytes)\n",
- event->header_.len_));
- return -1;
- }
- }
-
- // At this point there is a complete, valid header in Event. Now we
- // need to get the event payload. Due to incomplete reads this may
- // not be the first time we've read in a fragment for this message.
- // We account for this here. Note that the first time in here
- // <msg_frag_->wr_ptr> will point to <event->data_>. Every time we
- // do a successful fragment read, we advance <wr_ptr>. Therefore,
- // by subtracting how much we've already read from the
- // <event->header_.len_> we complete the
- // <data_bytes_left_to_read>...
-
- ssize_t data_bytes_left_to_read =
- ssize_t (event->header_.len_ - (msg_frag_->wr_ptr () - event->data_));
-
- ssize_t data_received =
- this->peer ().recv (this->msg_frag_->wr_ptr (),
- data_bytes_left_to_read);
-
- // Try to receive the remainder of the event.
-
- switch (data_received)
- {
- case -1:
- if (errno == EWOULDBLOCK)
- // This might happen if only the header came through.
- return -1;
- else
- /* FALLTHROUGH */;
-
- case 0: // Premature EOF.
- this->msg_frag_ = this->msg_frag_->release ();
- return 0;
-
- default:
- // Set the write pointer at 1 past the end of the event.
- this->msg_frag_->wr_ptr (data_received);
-
- if (data_received != data_bytes_left_to_read)
- {
- errno = EWOULDBLOCK;
- // Inform caller that we didn't get the whole event.
- return -1;
- }
- else
- {
- // Set the read pointer to the beginning of the event.
- this->msg_frag_->rd_ptr (this->msg_frag_->base ());
-
- mb = this->msg_frag_;
-
- // Reset the pointer to indicate we've got an entire event.
- this->msg_frag_ = 0;
- }
-
- ACE_DEBUG ((LM_DEBUG,
- "(%t) connection id = %d, cur len = %d, total bytes read = %d\n",
- event->header_.connection_id_,
- event->header_.len_,
- data_received + header_received));
- if (Options::instance ()->enabled (Options::VERBOSE))
- ACE_DEBUG ((LM_DEBUG,
- "data_ = %*s\n",
- event->header_.len_ - 2,
- event->data_));
- return data_received + header_received;
- }
-}
-
-// Receive various types of input (e.g., Peer event from the gatewayd,
-// as well as stdio).
-
-int
-Peer_Handler::handle_input (ACE_HANDLE sd)
-{
- ACE_DEBUG ((LM_DEBUG, "in handle_input, sd = %d\n", sd));
- if (sd == ACE_STDIN) // Handle event from stdin.
- return this->transmit_stdin ();
- else
- // Perform the appropriate action depending on the state we are
- // in.
- return (this->*do_action_) ();
-}
-
-// Action that receives our connection id from the Gateway.
-
-int
-Peer_Handler::await_connection_id (void)
-{
- ssize_t n = this->peer ().recv (&this->connection_id_,
- sizeof this->connection_id_);
-
- if (n != sizeof this->connection_id_)
- {
- if (n == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "gatewayd has closed down unexpectedly\n"),
- -1);
- else
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p, bytes received on handle %d = %d\n",
- "recv",
- this->get_handle (),
- n),
- -1);
- }
- else
- {
- this->connection_id_ = ntohl (this->connection_id_);
- ACE_DEBUG ((LM_DEBUG,
- "assigned connection id %d\n",
- this->connection_id_));
- }
-
- // Subscribe for events if we're a Consumer.
- if (Options::instance ()->enabled (Options::CONSUMER_CONNECTOR))
- this->subscribe ();
-
- // Transition to the action that waits for Peer events.
- this->do_action_ = &Peer_Handler::await_events;
-
- // Reset standard input.
- ACE_OS::rewind (stdin);
-
- // Register this handler to receive test events on stdin.
- if (ACE::register_stdin_handler (this,
- ACE_Reactor::instance (),
- ACE_Thread_Manager::instance ()) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "(%t) %p\n", "register_stdin_handler"), -1);
-
- return 0;
-}
-
-int
-Peer_Handler::subscribe (void)
-{
- ACE_Message_Block *mb;
-
- ACE_NEW_RETURN (mb,
- ACE_Message_Block (sizeof (Event)),
- -1);
-
- Subscription *subscription = (Subscription *) ((Event *) mb->rd_ptr ())->data_;
- subscription->connection_id_ = Options::instance ()->connection_id ();
- return this->transmit (mb, sizeof *subscription, SUBSCRIPTION_EVENT);
-}
-
-// Action that receives events from the Gateway.
-
-int
-Peer_Handler::await_events (void)
-{
- ACE_Message_Block *mb = 0;
-
- ssize_t n = this->recv (mb);
-
- switch (n)
- {
- case 0:
- ACE_ERROR_RETURN ((LM_ERROR,
- "gatewayd has closed down\n"),
- -1);
- /* NOTREACHED */
- case -1:
- if (errno == EWOULDBLOCK)
- // A short-read, we'll come back and finish it up later on!
- return 0;
- else
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "recv"),
- -1);
- /* NOTREACHED */
- default:
- {
- // We got a valid event, so let's process it now! At the
- // moment, we just print out the event contents...
-
- Event *event = (Event *) mb->rd_ptr ();
- this->total_bytes_ += mb->length ();
-
- ACE_DEBUG ((LM_DEBUG,
- "route id = %d, cur len = %d, total len = %d\n",
- event->header_.connection_id_,
- event->header_.len_,
- this->total_bytes_));
- if (Options::instance ()->enabled (Options::VERBOSE))
- ACE_DEBUG ((LM_DEBUG,
- "data_ = %s\n",
- event->data_));
- mb->release ();
- return 0;
- }
- }
-}
-
-// Periodically send events via ACE_Reactor timer mechanism.
-
-int
-Peer_Handler::handle_timeout (const ACE_Time_Value &,
- const void *)
-{
- // Shut down the handler.
- return this->handle_close ();
-}
-
-Peer_Handler::~Peer_Handler (void)
-{
- // Shut down the handler.
- this->handle_close ();
-}
-
-// Handle shutdown of the Peer object.
-
-int
-Peer_Handler::handle_close (ACE_HANDLE,
- ACE_Reactor_Mask)
-{
- if (this->get_handle () != ACE_INVALID_HANDLE)
- {
- ACE_DEBUG ((LM_DEBUG, "shutting down Peer on handle %d\n",
- this->get_handle ()));
-
- ACE_Reactor_Mask mask = ACE_Event_Handler::DONT_CALL | ACE_Event_Handler::READ_MASK;
-
- // Explicitly remove ourselves for ACE_STDIN (the <ACE_Reactor>
- // removes the HANDLE. Note that <ACE_Event_Handler::DONT_CALL>
- // instructs the ACE_Reactor *not* to call <handle_close>, which
- // would otherwise lead to infinite recursion!).
- ACE_Reactor::instance ()->remove_handler
- (ACE_STDIN, mask);
-
- // Deregister this handler with the ACE_Reactor.
- if (ACE_Reactor::instance ()->remove_handler
- (this, mask) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "handle = %d: %p\n",
- this->get_handle (),
- "remove_handler"),
- -1);
- // Close down the peer.
- this->peer ().close ();
- }
- return 0;
-}
-
-int
-Peer_Acceptor::open (u_short port)
-{
- // This object only gets allocated once and is just recycled
- // forever.
- ACE_NEW_RETURN (peer_handler_, Peer_Handler, -1);
-
- this->addr_.set (port);
-
- ACE_DEBUG ((LM_DEBUG,
- "opening acceptor at port %d\n",
- port));
-
- // Call down to the <Acceptor::open> method.
- if (this->inherited::open (this->addr_) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "open"),
- -1);
- else if (this->acceptor ().get_local_addr (this->addr_) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "get_local_addr"),
- -1);
- else
- ACE_DEBUG ((LM_DEBUG,
- "accepting at port %d\n",
- this->addr_.get_port_number ()));
- return 0;
-}
-
-Peer_Acceptor::Peer_Acceptor (void)
- : peer_handler_ (0)
-{
-}
-
-int
-Peer_Acceptor::close (void)
-{
- // Will trigger a delete.
- if (this->peer_handler_ != 0)
- this->peer_handler_->destroy ();
-
- // Close down the base class.
- return this->inherited::close ();
-}
-
-// Note how this method just passes back the pre-allocated
-// <Peer_Handler> instead of having the <ACE_Acceptor> allocate a new
-// one each time!
-
-int
-Peer_Acceptor::make_svc_handler (Peer_Handler *&sh)
-{
- sh = this->peer_handler_;
- return 0;
-}
-
-int
-Peer_Connector::open_connector (Peer_Handler *&peer_handler,
- u_short port)
-{
- // This object only gets allocated once and is just recycled
- // forever.
- ACE_NEW_RETURN (peer_handler,
- Peer_Handler,
- -1);
-
- ACE_INET_Addr addr (port,
- Options::instance ()->connector_host ());
-
- ACE_DEBUG ((LM_DEBUG,
- "connecting to %s:%d\n",
- addr.get_host_name (),
- addr.get_port_number ()));
-
- if (this->connect (peer_handler, addr) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "connect"),
- -1);
- else
- ACE_DEBUG ((LM_DEBUG,
- "connected to %s:%d\n",
- addr.get_host_name (),
- addr.get_port_number ()));
- return 0;
-}
-
-int
-Peer_Connector::open (void)
-{
- this->supplier_peer_handler_ = 0;
- this->consumer_peer_handler_ = 0;
-
- if (Options::instance ()->enabled (Options::SUPPLIER_CONNECTOR)
- && this->open_connector (this->supplier_peer_handler_,
- Options::instance ()->supplier_connector_port ()) == -1)
- return -1;
-
- if (Options::instance ()->enabled (Options::CONSUMER_CONNECTOR)
- && this->open_connector (this->consumer_peer_handler_,
- Options::instance ()->consumer_connector_port ()) == -1)
- return -1;
-
- return 0;
-}
-
-int
-Peer_Factory::handle_signal (int signum, siginfo_t *, ucontext_t *)
-{
- ACE_DEBUG ((LM_DEBUG,
- "signal %S occurred\n",
- signum));
-
- if (signum != SIGPIPE)
- // Shut down the main event loop.
- ACE_Reactor::end_event_loop();
-
- return 0;
-}
-
-// Returns information on the currently active service.
-
-int
-Peer_Factory::info (char **strp, size_t length) const
-{
- char buf[BUFSIZ];
- char consumer_addr_str[BUFSIZ];
- char supplier_addr_str[BUFSIZ];
-
- ACE_INET_Addr addr;
-
- if (this->consumer_acceptor_.acceptor ().get_local_addr (addr) == -1)
- return -1;
- else if (addr.addr_to_string (consumer_addr_str,
- sizeof addr) == -1)
- return -1;
- else if (this->supplier_acceptor_.acceptor ().get_local_addr (addr) == -1)
- return -1;
- else if (addr.addr_to_string (supplier_addr_str,
- sizeof addr) == -1)
- return -1;
-
- ACE_OS::sprintf (buf,
- "%s\t C:%s|S:%s/%s %s",
- "peerd",
- consumer_addr_str,
- supplier_addr_str,
- "tcp",
- "# Gateway traffic generator and data sink\n");
-
- if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0)
- return -1;
- else
- ACE_OS::strncpy (*strp, buf, length);
- return ACE_OS::strlen (buf);
-}
-
-// Hook called by the explicit dynamic linking facility to terminate
-// the peer.
-
-int
-Peer_Factory::fini (void)
-{
- this->consumer_acceptor_.close ();
- this->supplier_acceptor_.close ();
- return 0;
-}
-
-// Hook called by the explicit dynamic linking facility to initialize
-// the peer.
-
-int
-Peer_Factory::init (int argc, char *argv[])
-{
- Options::instance ()->parse_args (argc, argv);
-
- ACE_Sig_Set sig_set;
-
- sig_set.sig_add (SIGINT);
- sig_set.sig_add (SIGQUIT);
- sig_set.sig_add (SIGPIPE);
-
- // Register ourselves to receive signals so we can shut down
- // gracefully.
-
- if (ACE_Reactor::instance ()->register_handler (sig_set,
- this) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "register_handler"), -1);
-
- if (Options::instance ()->enabled (Options::SUPPLIER_ACCEPTOR)
- && this->consumer_acceptor_.open
- (Options::instance ()->supplier_acceptor_port ()) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "Acceptor::open"),
- -1);
- else if (Options::instance ()->enabled (Options::CONSUMER_ACCEPTOR)
- && this->supplier_acceptor_.open
- (Options::instance ()->consumer_acceptor_port ()) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "Acceptor::open"),
- -1);
- else if (this->connector_.open () == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "Connector::open"),
- -1);
- return 0;
-}
-
-// The following is a "Factory" used by the <ACE_Service_Config> and
-// svc.conf file to dynamically initialize the <Peer_Acceptor> and
-// <Peer_Connector>.
-
-ACE_SVC_FACTORY_DEFINE (Peer_Factory)
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Acceptor<Peer_Handler, ACE_SOCK_ACCEPTOR>;
-template class ACE_Connector<Peer_Handler, ACE_SOCK_CONNECTOR>;
-template class ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Peer_Handler> *, ACE_SYNCH_RW_MUTEX>;
-template class ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Peer_Handler> *, ACE_SYNCH_RW_MUTEX>;
-template class ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Peer_Handler> *, ACE_SYNCH_RW_MUTEX>;
-template class ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Peer_Handler> *, ACE_SYNCH_RW_MUTEX>;
-template class ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Peer_Handler> *>;
-template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>;
-template class ACE_Svc_Tuple<Peer_Handler>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate ACE_Acceptor<Peer_Handler, ACE_SOCK_ACCEPTOR>
-#pragma instantiate ACE_Connector<Peer_Handler, ACE_SOCK_CONNECTOR>
-#pragma instantiate ACE_Map_Manager<ACE_HANDLE, ACE_Svc_Tuple<Peer_Handler> *, ACE_SYNCH_RW_MUTEX>
-#pragma instantiate ACE_Map_Iterator_Base<ACE_HANDLE, ACE_Svc_Tuple<Peer_Handler> *, ACE_SYNCH_RW_MUTEX>
-#pragma instantiate ACE_Map_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Peer_Handler> *, ACE_SYNCH_RW_MUTEX>
-#pragma instantiate ACE_Map_Reverse_Iterator<ACE_HANDLE, ACE_Svc_Tuple<Peer_Handler> *, ACE_SYNCH_RW_MUTEX>
-#pragma instantiate ACE_Map_Entry<ACE_HANDLE, ACE_Svc_Tuple<Peer_Handler> *>
-#pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
-#pragma instantiate ACE_Svc_Tuple<Peer_Handler>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/apps/Gateway/Peer/Peer.dsp b/apps/Gateway/Peer/Peer.dsp
deleted file mode 100644
index 9e162c4f1a8..00000000000
--- a/apps/Gateway/Peer/Peer.dsp
+++ /dev/null
@@ -1,64 +0,0 @@
-# Microsoft Developer Studio Project File - Name="Peer" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=Peer - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "Peer.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "Peer.mak" CFG="Peer - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "Peer - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\\" /I "..\Gateway" /D "_WINDOWS" /D "WIN32" /D "_DEBUG" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\ace"
-# Begin Target
-
-# Name "Peer - Win32 Debug"
-# Begin Source File
-
-SOURCE=.\Options.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Peer.cpp
-# End Source File
-# End Target
-# End Project
diff --git a/apps/Gateway/Peer/Peer.dsw b/apps/Gateway/Peer/Peer.dsw
deleted file mode 100644
index 0cb1de9dcd2..00000000000
--- a/apps/Gateway/Peer/Peer.dsw
+++ /dev/null
@@ -1,44 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 5.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "Peer"=.\Peer.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "peerd"=.\peerd.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name Peer
- End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/apps/Gateway/Peer/Peer.h b/apps/Gateway/Peer/Peer.h
deleted file mode 100644
index 67b9a936dd7..00000000000
--- a/apps/Gateway/Peer/Peer.h
+++ /dev/null
@@ -1,230 +0,0 @@
-/* -*- C++ -*- */
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// gateway
-//
-// = FILENAME
-// Peer.h
-//
-// = DESCRIPTION
-// These classes process Supplier/Consumer events sent from the
-// gateway (gatewayd) to its various peers (peerd). The general
-// collaboration works as follows:
-//
-// 1. <Peer_Acceptor> creates a listener endpoint and waits
-// passively for gatewayd to connect with it.
-//
-// 2. When a gatewayd connects, <Peer_Acceptor> creates an
-// <Peer_Handler> object that sends/receives events from
-// gatewayd on that connection.
-//
-// 3. The <Peer_Handler> waits for gatewayd to inform it of its
-// connection ID, which is prepended to all subsequent outgoing
-// events sent from peerd.
-//
-// 4. Once the connection ID is set, peerd periodically sends events
-// to gatewayd. Peerd also receives and "processes" events
-// forwarded to it from gatewayd. In this program, peerd
-// "processes" the events sent to it by writing them to stdout.
-//
-// Note that in the current peerd implementation, one Peer process
-// cannot serve as both a Consumer and Supplier of Events. This is
-// because the gatewayd establishes a separate connection for
-// Suppliers and Consumers and the peerd only maintains a single
-// <Peer_Handler> object to handle this one connection. Enhancing
-// this implementation to be both a Consumer and Supplier
-// simultaneously is straightforward, however. In addition,
-// multiple peerd processes can already work together to play these
-// different roles.
-//
-// = AUTHOR
-// Douglas C. Schmidt
-//
-// ============================================================================
-
-#if !defined (PEER_H)
-#define PEER_H
-
-#include "ace/Service_Config.h"
-#include "ace/Acceptor.h"
-#include "ace/Connector.h"
-#include "ace/SOCK_Acceptor.h"
-#include "ace/SOCK_Connector.h"
-#include "Options.h"
-
-ACE_SVC_FACTORY_DECLARE (Peer_Factory)
-
-class ACE_Svc_Export Peer_Handler : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
-{
- // = TITLE
- // Handle Peer events arriving from a Gateway.
-public:
- // = Initialization and termination methods.
- Peer_Handler (void);
- // Initialize the peer.
-
- ~Peer_Handler (void);
- // Shutdown the Peer.
-
- virtual int open (void * = 0);
- // Initialize the handler when called by
- // <ACE_Acceptor::handle_input>.
-
- virtual int handle_input (ACE_HANDLE);
- // Receive and process peer events.
-
- virtual int put (ACE_Message_Block *, ACE_Time_Value *tv = 0);
- // Send a event to a gateway (may be queued if necessary due to flow
- // control).
-
- virtual int handle_output (ACE_HANDLE);
- // Finish sending a event when flow control conditions abate.
-
- virtual int handle_timeout (const ACE_Time_Value &,
- const void *arg);
- // Periodically send events via <ACE_Reactor> timer mechanism.
-
- virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE,
- ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK);
- // Perform object termination.
-
-protected:
- typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> inherited;
-
- int transmit (ACE_Message_Block *mb,
- size_t n,
- int event_type);
- // Transmit <mb> to the gatewayd.
-
- virtual int recv (ACE_Message_Block *&mb);
- // Receive an Peer event from gatewayd.
-
- virtual int send (ACE_Message_Block *mb);
- // Send an Peer event to gatewayd, using <nonblk_put>.
-
- virtual int nonblk_put (ACE_Message_Block *mb);
- // Perform a non-blocking <put>, which tries to send an event to the
- // gatewayd, but only if it isn't flow controlled.
-
- int subscribe (void);
- // Register Consumer subscriptions with the gateway.
-
- // = Event/state/action handlers.
- int transmit_stdin (void);
- // Receive a event from stdin and send it to the gateway.
-
- int await_connection_id (void);
- // Action that receives the route id.
-
- int await_events (void);
- // Action that receives events.
-
- int (Peer_Handler::*do_action_)(void);
- // Pointer-to-member-function for the current action to run in this
- // state. This points to one of the preceding 3 methods.
-
- CONNECTION_ID connection_id_;
- // Connection ID of the peer, which is obtained from the gatewayd.
-
- ACE_Message_Block *msg_frag_;
- // Keep track of event fragments that arrive in non-blocking recv's
- // from the gatewayd.
-
- size_t total_bytes_;
- // The total number of bytes sent/received to the gatewayd thus far.
-};
-
-class ACE_Svc_Export Peer_Acceptor : public ACE_Acceptor<Peer_Handler, ACE_SOCK_ACCEPTOR>
-{
- // = TITLE
- // Passively accept connections from gatewayd and dynamically
- // create a new <Peer_Handler> object to communicate with the
- // gatewayd.
-public:
- // = Initialization and termination methods.
- Peer_Acceptor (void);
- // Default initialization.
-
- int open (u_short);
- // the <Peer_Acceptor>.
-
- int close (void);
- // Terminate the <Peer_Acceptor>.
-
- virtual int make_svc_handler (Peer_Handler *&);
- // Factory method that creates a <Peer_Handler> just once.
-
-private:
- int open_acceptor (u_short port);
- // Factor out common code for initializing the <Peer_Acceptor>.
-
- Peer_Handler *peer_handler_;
- // Pointer to <Peer_Handler> allocated just once.
-
- ACE_INET_Addr addr_;
- // Our acceptor addr.
-
- typedef ACE_Acceptor<Peer_Handler, ACE_SOCK_ACCEPTOR> inherited;
-};
-
-class ACE_Svc_Export Peer_Connector : public ACE_Connector<Peer_Handler, ACE_SOCK_CONNECTOR>
-{
- // = TITLE
- // Actively establish connections with gatewayd and dynamically
- // create a new <Peer_Handler> object to communicate with the
- // gatewayd.
-public:
- // = Initialization method.
- int open (void);
- // Initialize the <Peer_Connector>.
-
-private:
- int open_connector (Peer_Handler *&ph, u_short port);
- // Factor out common code for initializing the <Peer_Connector>.
-
- Peer_Handler *consumer_peer_handler_;
- // Consumer <Peer_Handler> that is connected to a gatewayd.
-
- Peer_Handler *supplier_peer_handler_;
- // Supplier <Peer_Handler> that is connected to a gatewayd.
-};
-
-class ACE_Svc_Export Peer_Factory : public ACE_Service_Object
-{
- // = TITLE
- // A factory class that actively and/or passively establishes
- // connections with the gatewayd.
-public:
- // = Dynamic initialization and termination hooks from <ACE_Service_Object>.
-
- virtual int init (int argc, char *argv[]);
- // Initialize the acceptor and connector.
-
- virtual int fini (void);
- // Perform termination activities.
-
- virtual int info (char **, size_t) const;
- // Return info about this service.
-
- virtual int handle_signal (int signum, siginfo_t *, ucontext_t *);
- // Handle various signals (e.g., SIGPIPE, SIGINT, and SIGQUIT).
-
-private:
- Peer_Acceptor consumer_acceptor_;
- // Pointer to an instance of our <Peer_Acceptor> that's used to
- // accept connections and create Consumers.
-
- Peer_Acceptor supplier_acceptor_;
- // Pointer to an instance of our <Peer_Acceptor> that's used to
- // accept connections and create Suppliers.
-
- Peer_Connector connector_;
- // An instance of our <Peer_Connector>. Note that one
- // <Peer_Connector> is used to establish <Peer_Handler>s for both
- // Consumers and Suppliers.
-};
-
-#endif /* PEER_H */
diff --git a/apps/Gateway/Peer/Peer4.mak b/apps/Gateway/Peer/Peer4.mak
deleted file mode 100644
index fa0c6203f76..00000000000
--- a/apps/Gateway/Peer/Peer4.mak
+++ /dev/null
@@ -1,594 +0,0 @@
-# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-!IF "$(CFG)" == ""
-CFG=Peer - Win32 Debug
-!MESSAGE No configuration specified. Defaulting to Peer - Win32 Debug.
-!ENDIF
-
-!IF "$(CFG)" != "peerd - Win32 Debug" && "$(CFG)" != "Peer - Win32 Debug"
-!MESSAGE Invalid configuration "$(CFG)" specified.
-!MESSAGE You can specify a configuration when running NMAKE on this makefile
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "Peer4.mak" CFG="Peer - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "peerd - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE "Peer - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-!ERROR An invalid configuration is specified.
-!ENDIF
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE
-NULL=nul
-!ENDIF
-################################################################################
-# Begin Project
-# PROP Target_Last_Scanned "Peer - Win32 Debug"
-
-!IF "$(CFG)" == "peerd - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "peerd\Debug"
-# PROP BASE Intermediate_Dir "peerd\Debug"
-# PROP BASE Target_Dir "peerd"
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "."
-# PROP Intermediate_Dir "peerd_Debug"
-# PROP Target_Dir "peerd"
-OUTDIR=.\.
-INTDIR=.\peerd_Debug
-
-ALL : "Peer - Win32 Debug" "$(OUTDIR)\peerd.exe"
-
-CLEAN :
- -@erase "$(INTDIR)\peerd.obj"
- -@erase "$(INTDIR)\vc40.idb"
- -@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\peerd.exe"
- -@erase "$(OUTDIR)\peerd.ilk"
- -@erase "$(OUTDIR)\peerd.pdb"
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-"$(INTDIR)" :
- if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
-
-CPP=cl.exe
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /c
-CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE"\
- /Fp"$(INTDIR)/peerd.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c
-CPP_OBJS=.\peerd_Debug/
-CPP_SBRS=.\.
-
-.c{$(CPP_OBJS)}.obj:
- $(CPP) $(CPP_PROJ) $<
-
-.cpp{$(CPP_OBJS)}.obj:
- $(CPP) $(CPP_PROJ) $<
-
-.cxx{$(CPP_OBJS)}.obj:
- $(CPP) $(CPP_PROJ) $<
-
-.c{$(CPP_SBRS)}.sbr:
- $(CPP) $(CPP_PROJ) $<
-
-.cpp{$(CPP_SBRS)}.sbr:
- $(CPP) $(CPP_PROJ) $<
-
-.cxx{$(CPP_SBRS)}.sbr:
- $(CPP) $(CPP_PROJ) $<
-
-RSC=rc.exe
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/peerd.bsc"
-BSC32_SBRS= \
-
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386
-# ADD LINK32 Peer.lib aced.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386
-LINK32_FLAGS=Peer.lib aced.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
- comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib\
- odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes\
- /pdb:"$(OUTDIR)/peerd.pdb" /debug /machine:I386 /out:"$(OUTDIR)/peerd.exe"
-LINK32_OBJS= \
- "$(INTDIR)\peerd.obj" \
- "$(OUTDIR)\Peer.lib"
-
-"$(OUTDIR)\peerd.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-
-!ELSEIF "$(CFG)" == "Peer - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Peer\Debug"
-# PROP BASE Intermediate_Dir "Peer\Debug"
-# PROP BASE Target_Dir "Peer"
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "."
-# PROP Intermediate_Dir "Peer_Debug"
-# PROP Target_Dir "Peer"
-OUTDIR=.\.
-INTDIR=.\Peer_Debug
-
-ALL : "$(OUTDIR)\Peer.dll"
-
-CLEAN :
- -@erase "$(INTDIR)\Options.obj"
- -@erase "$(INTDIR)\Peer.obj"
- -@erase "$(INTDIR)\vc40.idb"
- -@erase "$(INTDIR)\vc40.pdb"
- -@erase "$(OUTDIR)\Peer.dll"
- -@erase "$(OUTDIR)\Peer.exp"
- -@erase "$(OUTDIR)\Peer.ilk"
- -@erase "$(OUTDIR)\Peer.lib"
- -@erase "$(OUTDIR)\Peer.pdb"
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-"$(INTDIR)" :
- if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
-
-CPP=cl.exe
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Gateway" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
-CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Gateway" /D "WIN32" /D\
- "_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/Peer.pch" /YX /Fo"$(INTDIR)/"\
- /Fd"$(INTDIR)/" /c
-CPP_OBJS=.\Peer_Debug/
-CPP_SBRS=.\.
-
-.c{$(CPP_OBJS)}.obj:
- $(CPP) $(CPP_PROJ) $<
-
-.cpp{$(CPP_OBJS)}.obj:
- $(CPP) $(CPP_PROJ) $<
-
-.cxx{$(CPP_OBJS)}.obj:
- $(CPP) $(CPP_PROJ) $<
-
-.c{$(CPP_SBRS)}.sbr:
- $(CPP) $(CPP_PROJ) $<
-
-.cpp{$(CPP_SBRS)}.sbr:
- $(CPP) $(CPP_PROJ) $<
-
-.cxx{$(CPP_SBRS)}.sbr:
- $(CPP) $(CPP_PROJ) $<
-
-MTL=mktyplib.exe
-# ADD BASE MTL /nologo /D "_DEBUG" /win32
-# ADD MTL /nologo /D "_DEBUG" /win32
-MTL_PROJ=/nologo /D "_DEBUG" /win32
-RSC=rc.exe
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/Peer.bsc"
-BSC32_SBRS= \
-
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
-# ADD LINK32 aced.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
-LINK32_FLAGS=aced.lib kernel32.lib user32.lib gdi32.lib winspool.lib\
- comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib\
- odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /incremental:yes\
- /pdb:"$(OUTDIR)/Peer.pdb" /debug /machine:I386 /out:"$(OUTDIR)/Peer.dll"\
- /implib:"$(OUTDIR)/Peer.lib"
-LINK32_OBJS= \
- "$(INTDIR)\Options.obj" \
- "$(INTDIR)\Peer.obj"
-
-"$(OUTDIR)\Peer.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-
-!ENDIF
-
-################################################################################
-# Begin Target
-
-# Name "peerd - Win32 Debug"
-################################################################################
-# Begin Project Dependency
-
-# Project_Dep_Name "Peer"
-
-!IF "$(CFG)" == "peerd - Win32 Debug"
-
-"Peer - Win32 Debug" :
- $(MAKE) /$(MAKEFLAGS) /F ".\Peer4.mak" CFG="Peer - Win32 Debug"
-
-!ENDIF
-
-# End Project Dependency
-################################################################################
-# Begin Source File
-
-SOURCE=.\peerd.cpp
-DEP_CPP_PEERD=\
- "..\..\..\ace\config-win32.h"\
- "..\Gateway\Event.h"\
- ".\Options.h"\
- ".\Peer.h"\
- {$(INCLUDE)}"\ace\Acceptor.cpp"\
- {$(INCLUDE)}"\ace\Acceptor.h"\
- {$(INCLUDE)}"\ace\Acceptor.i"\
- {$(INCLUDE)}"\ace\ACE.h"\
- {$(INCLUDE)}"\ace\ACE.i"\
- {$(INCLUDE)}"\ace\Addr.h"\
- {$(INCLUDE)}"\ace\Addr.i"\
- {$(INCLUDE)}"\ace\Atomic_Op.i"\
- {$(INCLUDE)}"\ace\Auto_Ptr.cpp"\
- {$(INCLUDE)}"\ace\Auto_Ptr.h"\
- {$(INCLUDE)}"\ace\Auto_Ptr.i"\
- {$(INCLUDE)}"\ace\Basic_Types.h"\
- {$(INCLUDE)}"\ace\Basic_Types.i"\
- {$(INCLUDE)}"\ace\config-win32-common.h"\
- {$(INCLUDE)}"\ace\config.h"\
- {$(INCLUDE)}"\ace\Connector.cpp"\
- {$(INCLUDE)}"\ace\Connector.h"\
- {$(INCLUDE)}"\ace\Connector.i"\
- {$(INCLUDE)}"\ace\Containers.cpp"\
- {$(INCLUDE)}"\ace\Containers.h"\
- {$(INCLUDE)}"\ace\Containers.i"\
- {$(INCLUDE)}"\ace\Dynamic.h"\
- {$(INCLUDE)}"\ace\Dynamic.i"\
- {$(INCLUDE)}"\ace\Event_Handler.h"\
- {$(INCLUDE)}"\ace\Event_Handler.i"\
- {$(INCLUDE)}"\ace\Free_List.cpp"\
- {$(INCLUDE)}"\ace\Free_List.h"\
- {$(INCLUDE)}"\ace\Free_List.i"\
- {$(INCLUDE)}"\ace\Handle_Set.h"\
- {$(INCLUDE)}"\ace\Handle_Set.i"\
- {$(INCLUDE)}"\ace\Hash_Map_Manager.cpp"\
- {$(INCLUDE)}"\ace\Hash_Map_Manager.h"\
- {$(INCLUDE)}"\ace\inc_user_config.h"\
- {$(INCLUDE)}"\ace\INET_Addr.h"\
- {$(INCLUDE)}"\ace\INET_Addr.i"\
- {$(INCLUDE)}"\ace\IO_Cntl_Msg.h"\
- {$(INCLUDE)}"\ace\iosfwd.h"\
- {$(INCLUDE)}"\ace\IPC_SAP.h"\
- {$(INCLUDE)}"\ace\IPC_SAP.i"\
- {$(INCLUDE)}"\ace\Log_Msg.h"\
- {$(INCLUDE)}"\ace\Log_Priority.h"\
- {$(INCLUDE)}"\ace\Log_Record.h"\
- {$(INCLUDE)}"\ace\Log_Record.i"\
- {$(INCLUDE)}"\ace\Malloc.h"\
- {$(INCLUDE)}"\ace\Malloc.i"\
- {$(INCLUDE)}"\ace\Malloc_T.cpp"\
- {$(INCLUDE)}"\ace\Malloc_T.h"\
- {$(INCLUDE)}"\ace\Malloc_T.i"\
- {$(INCLUDE)}"\ace\Managed_Object.cpp"\
- {$(INCLUDE)}"\ace\Managed_Object.h"\
- {$(INCLUDE)}"\ace\Managed_Object.i"\
- {$(INCLUDE)}"\ace\Map_Manager.cpp"\
- {$(INCLUDE)}"\ace\Map_Manager.h"\
- {$(INCLUDE)}"\ace\Map_Manager.i"\
- {$(INCLUDE)}"\ace\Mem_Map.h"\
- {$(INCLUDE)}"\ace\Mem_Map.i"\
- {$(INCLUDE)}"\ace\Memory_Pool.h"\
- {$(INCLUDE)}"\ace\Memory_Pool.i"\
- {$(INCLUDE)}"\ace\Message_Block.h"\
- {$(INCLUDE)}"\ace\Message_Block.i"\
- {$(INCLUDE)}"\ace\Message_Queue.cpp"\
- {$(INCLUDE)}"\ace\Message_Queue.h"\
- {$(INCLUDE)}"\ace\Message_Queue.i"\
- {$(INCLUDE)}"\ace\Module.cpp"\
- {$(INCLUDE)}"\ace\Module.h"\
- {$(INCLUDE)}"\ace\Module.i"\
- {$(INCLUDE)}"\ace\Object_Manager.h"\
- {$(INCLUDE)}"\ace\Object_Manager.i"\
- {$(INCLUDE)}"\ace\OS.h"\
- {$(INCLUDE)}"\ace\OS.i"\
- {$(INCLUDE)}"\ace\Reactor.h"\
- {$(INCLUDE)}"\ace\Reactor.i"\
- {$(INCLUDE)}"\ace\Reactor_Impl.h"\
- {$(INCLUDE)}"\ace\Service_Config.h"\
- {$(INCLUDE)}"\ace\Service_Config.i"\
- {$(INCLUDE)}"\ace\Service_Object.h"\
- {$(INCLUDE)}"\ace\Service_Object.i"\
- {$(INCLUDE)}"\ace\Service_Types.h"\
- {$(INCLUDE)}"\ace\Service_Types.i"\
- {$(INCLUDE)}"\ace\Shared_Object.h"\
- {$(INCLUDE)}"\ace\Shared_Object.i"\
- {$(INCLUDE)}"\ace\Signal.h"\
- {$(INCLUDE)}"\ace\Signal.i"\
- {$(INCLUDE)}"\ace\Singleton.cpp"\
- {$(INCLUDE)}"\ace\Singleton.h"\
- {$(INCLUDE)}"\ace\Singleton.i"\
- {$(INCLUDE)}"\ace\SOCK.h"\
- {$(INCLUDE)}"\ace\SOCK.i"\
- {$(INCLUDE)}"\ace\SOCK_Acceptor.h"\
- {$(INCLUDE)}"\ace\SOCK_Acceptor.i"\
- {$(INCLUDE)}"\ace\SOCK_Connector.h"\
- {$(INCLUDE)}"\ace\SOCK_Connector.i"\
- {$(INCLUDE)}"\ace\SOCK_IO.h"\
- {$(INCLUDE)}"\ace\SOCK_IO.i"\
- {$(INCLUDE)}"\ace\SOCK_Stream.h"\
- {$(INCLUDE)}"\ace\SOCK_Stream.i"\
- {$(INCLUDE)}"\ace\SString.h"\
- {$(INCLUDE)}"\ace\SString.i"\
- {$(INCLUDE)}"\ace\Strategies.h"\
- {$(INCLUDE)}"\ace\Strategies_T.cpp"\
- {$(INCLUDE)}"\ace\Strategies_T.h"\
- {$(INCLUDE)}"\ace\Stream_Modules.cpp"\
- {$(INCLUDE)}"\ace\Stream_Modules.h"\
- {$(INCLUDE)}"\ace\Stream_Modules.i"\
- {$(INCLUDE)}"\ace\streams.h"\
- {$(INCLUDE)}"\ace\SV_Semaphore_Complex.h"\
- {$(INCLUDE)}"\ace\SV_Semaphore_Complex.i"\
- {$(INCLUDE)}"\ace\SV_Semaphore_Simple.h"\
- {$(INCLUDE)}"\ace\SV_Semaphore_Simple.i"\
- {$(INCLUDE)}"\ace\Svc_Conf_Tokens.h"\
- {$(INCLUDE)}"\ace\Svc_Handler.cpp"\
- {$(INCLUDE)}"\ace\Svc_Handler.h"\
- {$(INCLUDE)}"\ace\Svc_Handler.i"\
- {$(INCLUDE)}"\ace\Synch.h"\
- {$(INCLUDE)}"\ace\Synch.i"\
- {$(INCLUDE)}"\ace\Synch_Options.h"\
- {$(INCLUDE)}"\ace\Synch_T.cpp"\
- {$(INCLUDE)}"\ace\Synch_T.h"\
- {$(INCLUDE)}"\ace\Synch_T.i"\
- {$(INCLUDE)}"\ace\sys_conf.h"\
- {$(INCLUDE)}"\ace\Task.h"\
- {$(INCLUDE)}"\ace\Task.i"\
- {$(INCLUDE)}"\ace\Task_T.cpp"\
- {$(INCLUDE)}"\ace\Task_T.h"\
- {$(INCLUDE)}"\ace\Task_T.i"\
- {$(INCLUDE)}"\ace\Thread.h"\
- {$(INCLUDE)}"\ace\Thread.i"\
- {$(INCLUDE)}"\ace\Thread_Manager.h"\
- {$(INCLUDE)}"\ace\Thread_Manager.i"\
- {$(INCLUDE)}"\ace\Time_Value.h"\
- {$(INCLUDE)}"\ace\Timer_Queue.h"\
- {$(INCLUDE)}"\ace\Timer_Queue_T.cpp"\
- {$(INCLUDE)}"\ace\Timer_Queue_T.h"\
- {$(INCLUDE)}"\ace\Timer_Queue_T.i"\
- {$(INCLUDE)}"\ace\Trace.h"\
- {$(INCLUDE)}"\ace\Version.h"\
- {$(INCLUDE)}"\ace\WFMO_Reactor.h"\
- {$(INCLUDE)}"\ace\WFMO_Reactor.i"\
- {$(INCLUDE)}"\ace\ws2tcpip.h"\
- {$(INCLUDE)}"\sys\stat.h"\
- {$(INCLUDE)}"\sys\types.h"\
-
-
-"$(INTDIR)\peerd.obj" : $(SOURCE) $(DEP_CPP_PEERD) "$(INTDIR)"
-
-
-# End Source File
-# End Target
-################################################################################
-# Begin Target
-
-# Name "Peer - Win32 Debug"
-################################################################################
-# Begin Source File
-
-SOURCE=.\Peer.cpp
-DEP_CPP_PEER_=\
- "..\..\..\ace\config-win32.h"\
- "..\Gateway\Event.h"\
- ".\Options.h"\
- ".\Peer.h"\
- {$(INCLUDE)}"\ace\Acceptor.cpp"\
- {$(INCLUDE)}"\ace\Acceptor.h"\
- {$(INCLUDE)}"\ace\Acceptor.i"\
- {$(INCLUDE)}"\ace\ACE.h"\
- {$(INCLUDE)}"\ace\ACE.i"\
- {$(INCLUDE)}"\ace\Addr.h"\
- {$(INCLUDE)}"\ace\Addr.i"\
- {$(INCLUDE)}"\ace\Atomic_Op.i"\
- {$(INCLUDE)}"\ace\Auto_Ptr.cpp"\
- {$(INCLUDE)}"\ace\Auto_Ptr.h"\
- {$(INCLUDE)}"\ace\Auto_Ptr.i"\
- {$(INCLUDE)}"\ace\Basic_Types.h"\
- {$(INCLUDE)}"\ace\Basic_Types.i"\
- {$(INCLUDE)}"\ace\config-win32-common.h"\
- {$(INCLUDE)}"\ace\config.h"\
- {$(INCLUDE)}"\ace\Connector.cpp"\
- {$(INCLUDE)}"\ace\Connector.h"\
- {$(INCLUDE)}"\ace\Connector.i"\
- {$(INCLUDE)}"\ace\Containers.cpp"\
- {$(INCLUDE)}"\ace\Containers.h"\
- {$(INCLUDE)}"\ace\Containers.i"\
- {$(INCLUDE)}"\ace\Dynamic.h"\
- {$(INCLUDE)}"\ace\Dynamic.i"\
- {$(INCLUDE)}"\ace\Event_Handler.h"\
- {$(INCLUDE)}"\ace\Event_Handler.i"\
- {$(INCLUDE)}"\ace\Free_List.cpp"\
- {$(INCLUDE)}"\ace\Free_List.h"\
- {$(INCLUDE)}"\ace\Free_List.i"\
- {$(INCLUDE)}"\ace\Handle_Set.h"\
- {$(INCLUDE)}"\ace\Handle_Set.i"\
- {$(INCLUDE)}"\ace\Hash_Map_Manager.cpp"\
- {$(INCLUDE)}"\ace\Hash_Map_Manager.h"\
- {$(INCLUDE)}"\ace\inc_user_config.h"\
- {$(INCLUDE)}"\ace\INET_Addr.h"\
- {$(INCLUDE)}"\ace\INET_Addr.i"\
- {$(INCLUDE)}"\ace\IO_Cntl_Msg.h"\
- {$(INCLUDE)}"\ace\iosfwd.h"\
- {$(INCLUDE)}"\ace\IPC_SAP.h"\
- {$(INCLUDE)}"\ace\IPC_SAP.i"\
- {$(INCLUDE)}"\ace\Log_Msg.h"\
- {$(INCLUDE)}"\ace\Log_Priority.h"\
- {$(INCLUDE)}"\ace\Log_Record.h"\
- {$(INCLUDE)}"\ace\Log_Record.i"\
- {$(INCLUDE)}"\ace\Malloc.h"\
- {$(INCLUDE)}"\ace\Malloc.i"\
- {$(INCLUDE)}"\ace\Malloc_T.cpp"\
- {$(INCLUDE)}"\ace\Malloc_T.h"\
- {$(INCLUDE)}"\ace\Malloc_T.i"\
- {$(INCLUDE)}"\ace\Managed_Object.cpp"\
- {$(INCLUDE)}"\ace\Managed_Object.h"\
- {$(INCLUDE)}"\ace\Managed_Object.i"\
- {$(INCLUDE)}"\ace\Map_Manager.cpp"\
- {$(INCLUDE)}"\ace\Map_Manager.h"\
- {$(INCLUDE)}"\ace\Map_Manager.i"\
- {$(INCLUDE)}"\ace\Mem_Map.h"\
- {$(INCLUDE)}"\ace\Mem_Map.i"\
- {$(INCLUDE)}"\ace\Memory_Pool.h"\
- {$(INCLUDE)}"\ace\Memory_Pool.i"\
- {$(INCLUDE)}"\ace\Message_Block.h"\
- {$(INCLUDE)}"\ace\Message_Block.i"\
- {$(INCLUDE)}"\ace\Message_Queue.cpp"\
- {$(INCLUDE)}"\ace\Message_Queue.h"\
- {$(INCLUDE)}"\ace\Message_Queue.i"\
- {$(INCLUDE)}"\ace\Module.cpp"\
- {$(INCLUDE)}"\ace\Module.h"\
- {$(INCLUDE)}"\ace\Module.i"\
- {$(INCLUDE)}"\ace\Object_Manager.h"\
- {$(INCLUDE)}"\ace\Object_Manager.i"\
- {$(INCLUDE)}"\ace\OS.h"\
- {$(INCLUDE)}"\ace\OS.i"\
- {$(INCLUDE)}"\ace\Reactor.h"\
- {$(INCLUDE)}"\ace\Reactor.i"\
- {$(INCLUDE)}"\ace\Reactor_Impl.h"\
- {$(INCLUDE)}"\ace\Service_Config.h"\
- {$(INCLUDE)}"\ace\Service_Config.i"\
- {$(INCLUDE)}"\ace\Service_Object.h"\
- {$(INCLUDE)}"\ace\Service_Object.i"\
- {$(INCLUDE)}"\ace\Service_Types.h"\
- {$(INCLUDE)}"\ace\Service_Types.i"\
- {$(INCLUDE)}"\ace\Shared_Object.h"\
- {$(INCLUDE)}"\ace\Shared_Object.i"\
- {$(INCLUDE)}"\ace\Signal.h"\
- {$(INCLUDE)}"\ace\Signal.i"\
- {$(INCLUDE)}"\ace\Singleton.cpp"\
- {$(INCLUDE)}"\ace\Singleton.h"\
- {$(INCLUDE)}"\ace\Singleton.i"\
- {$(INCLUDE)}"\ace\SOCK.h"\
- {$(INCLUDE)}"\ace\SOCK.i"\
- {$(INCLUDE)}"\ace\SOCK_Acceptor.h"\
- {$(INCLUDE)}"\ace\SOCK_Acceptor.i"\
- {$(INCLUDE)}"\ace\SOCK_Connector.h"\
- {$(INCLUDE)}"\ace\SOCK_Connector.i"\
- {$(INCLUDE)}"\ace\SOCK_IO.h"\
- {$(INCLUDE)}"\ace\SOCK_IO.i"\
- {$(INCLUDE)}"\ace\SOCK_Stream.h"\
- {$(INCLUDE)}"\ace\SOCK_Stream.i"\
- {$(INCLUDE)}"\ace\SString.h"\
- {$(INCLUDE)}"\ace\SString.i"\
- {$(INCLUDE)}"\ace\Strategies.h"\
- {$(INCLUDE)}"\ace\Strategies_T.cpp"\
- {$(INCLUDE)}"\ace\Strategies_T.h"\
- {$(INCLUDE)}"\ace\Stream_Modules.cpp"\
- {$(INCLUDE)}"\ace\Stream_Modules.h"\
- {$(INCLUDE)}"\ace\Stream_Modules.i"\
- {$(INCLUDE)}"\ace\streams.h"\
- {$(INCLUDE)}"\ace\SV_Semaphore_Complex.h"\
- {$(INCLUDE)}"\ace\SV_Semaphore_Complex.i"\
- {$(INCLUDE)}"\ace\SV_Semaphore_Simple.h"\
- {$(INCLUDE)}"\ace\SV_Semaphore_Simple.i"\
- {$(INCLUDE)}"\ace\Svc_Conf_Tokens.h"\
- {$(INCLUDE)}"\ace\Svc_Handler.cpp"\
- {$(INCLUDE)}"\ace\Svc_Handler.h"\
- {$(INCLUDE)}"\ace\Svc_Handler.i"\
- {$(INCLUDE)}"\ace\Synch.h"\
- {$(INCLUDE)}"\ace\Synch.i"\
- {$(INCLUDE)}"\ace\Synch_Options.h"\
- {$(INCLUDE)}"\ace\Synch_T.cpp"\
- {$(INCLUDE)}"\ace\Synch_T.h"\
- {$(INCLUDE)}"\ace\Synch_T.i"\
- {$(INCLUDE)}"\ace\sys_conf.h"\
- {$(INCLUDE)}"\ace\Task.h"\
- {$(INCLUDE)}"\ace\Task.i"\
- {$(INCLUDE)}"\ace\Task_T.cpp"\
- {$(INCLUDE)}"\ace\Task_T.h"\
- {$(INCLUDE)}"\ace\Task_T.i"\
- {$(INCLUDE)}"\ace\Thread.h"\
- {$(INCLUDE)}"\ace\Thread.i"\
- {$(INCLUDE)}"\ace\Thread_Manager.h"\
- {$(INCLUDE)}"\ace\Thread_Manager.i"\
- {$(INCLUDE)}"\ace\Time_Value.h"\
- {$(INCLUDE)}"\ace\Timer_Queue.h"\
- {$(INCLUDE)}"\ace\Timer_Queue_T.cpp"\
- {$(INCLUDE)}"\ace\Timer_Queue_T.h"\
- {$(INCLUDE)}"\ace\Timer_Queue_T.i"\
- {$(INCLUDE)}"\ace\Trace.h"\
- {$(INCLUDE)}"\ace\Version.h"\
- {$(INCLUDE)}"\ace\WFMO_Reactor.h"\
- {$(INCLUDE)}"\ace\WFMO_Reactor.i"\
- {$(INCLUDE)}"\ace\ws2tcpip.h"\
- {$(INCLUDE)}"\sys\stat.h"\
- {$(INCLUDE)}"\sys\types.h"\
-
-
-"$(INTDIR)\Peer.obj" : $(SOURCE) $(DEP_CPP_PEER_) "$(INTDIR)"
-
-
-# End Source File
-################################################################################
-# Begin Source File
-
-SOURCE=.\Options.cpp
-DEP_CPP_OPTIO=\
- "..\..\..\ace\config-win32.h"\
- "..\Gateway\Event.h"\
- ".\Options.h"\
- {$(INCLUDE)}"\ace\ACE.h"\
- {$(INCLUDE)}"\ace\ACE.i"\
- {$(INCLUDE)}"\ace\Auto_Ptr.cpp"\
- {$(INCLUDE)}"\ace\Auto_Ptr.h"\
- {$(INCLUDE)}"\ace\Auto_Ptr.i"\
- {$(INCLUDE)}"\ace\Basic_Types.h"\
- {$(INCLUDE)}"\ace\Basic_Types.i"\
- {$(INCLUDE)}"\ace\config-win32-common.h"\
- {$(INCLUDE)}"\ace\config.h"\
- {$(INCLUDE)}"\ace\Get_Opt.h"\
- {$(INCLUDE)}"\ace\Get_Opt.i"\
- {$(INCLUDE)}"\ace\inc_user_config.h"\
- {$(INCLUDE)}"\ace\iosfwd.h"\
- {$(INCLUDE)}"\ace\Log_Msg.h"\
- {$(INCLUDE)}"\ace\Log_Priority.h"\
- {$(INCLUDE)}"\ace\Log_Record.h"\
- {$(INCLUDE)}"\ace\Log_Record.i"\
- {$(INCLUDE)}"\ace\Managed_Object.cpp"\
- {$(INCLUDE)}"\ace\Managed_Object.h"\
- {$(INCLUDE)}"\ace\Managed_Object.i"\
- {$(INCLUDE)}"\ace\Object_Manager.h"\
- {$(INCLUDE)}"\ace\Object_Manager.i"\
- {$(INCLUDE)}"\ace\OS.h"\
- {$(INCLUDE)}"\ace\OS.i"\
- {$(INCLUDE)}"\ace\SString.h"\
- {$(INCLUDE)}"\ace\SString.i"\
- {$(INCLUDE)}"\ace\streams.h"\
- {$(INCLUDE)}"\ace\sys_conf.h"\
- {$(INCLUDE)}"\ace\Trace.h"\
- {$(INCLUDE)}"\ace\Version.h"\
- {$(INCLUDE)}"\ace\ws2tcpip.h"\
- {$(INCLUDE)}"\sys\stat.h"\
- {$(INCLUDE)}"\sys\types.h"\
-
-
-"$(INTDIR)\Options.obj" : $(SOURCE) $(DEP_CPP_OPTIO) "$(INTDIR)"
-
-
-# End Source File
-# End Target
-# End Project
-################################################################################
diff --git a/apps/Gateway/Peer/Peer4.mdp b/apps/Gateway/Peer/Peer4.mdp
deleted file mode 100644
index fb9763b8256..00000000000
--- a/apps/Gateway/Peer/Peer4.mdp
+++ /dev/null
Binary files differ
diff --git a/apps/Gateway/Peer/Peer_Message.h b/apps/Gateway/Peer/Peer_Message.h
deleted file mode 100644
index 67f57f148cb..00000000000
--- a/apps/Gateway/Peer/Peer_Message.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- C++ -*- */
-// $Id$
-
-// Define the Peer message schema (this may change).
-
-#if !defined (PEER_MESSAGE)
-#define PEER_MESSAGE
-
-// Fixed sized header.
-
-class Peer_Header
-{
-public:
-// Type used to route messages from gatewayd.
- typedef short ROUTING_ID;
-
- enum
- {
- INVALID_ID = -1 // No peer may use this number.
- };
-
- // Source ID.
- ROUTING_ID routing_id_;
-
- // Length of the message in bytes.
- size_t len_;
-};
-
-// Variable-sized message (buf_ may be variable-sized between
-// 0 and MAX_PAYLOAD_SIZE).
-
-class Peer_Message
-{
-public:
- // The maximum size of an Peer message (see Peer protocol specs for exact #).
- enum { MAX_PAYLOAD_SIZE = 1024 };
-
- Peer_Header header_;
-
- // Message payload
- char buf_[MAX_PAYLOAD_SIZE];
-};
-
-#endif /* PEER_MESSAGE */
diff --git a/apps/Gateway/Peer/peerd.cpp b/apps/Gateway/Peer/peerd.cpp
deleted file mode 100644
index 33444e4a78e..00000000000
--- a/apps/Gateway/Peer/peerd.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// gateway
-//
-// = FILENAME
-// peerd.h
-//
-// = DESCRIPTION
-// Driver for the peer daemon (peerd). Note that this is
-// completely generic code due to the Service Configurator
-// framework!
-//
-// = AUTHOR
-// Douglas C. Schmidt
-//
-// ============================================================================
-
-#include "Peer.h"
-
-int
-main (int argc, char *argv[])
-{
- if (ACE_Service_Config::open (argc, argv) == -1)
- {
- if (errno != ENOENT)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "open"),
- 1);
- else // Use static linking.
- {
- ACE_Service_Object_Ptr sp = ACE_SVC_INVOKE (Peer_Factory);
-
- if (sp->init (argc - 1, argv + 1) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "init"),
- 1);
-
- // Run forever, performing the configured services until we
- // are shut down by a SIGINT/SIGQUIT signal.
-
- ACE_Reactor::run_event_loop ();
-
- // Destructor of <ACE_Service_Object_Ptr> automagically call
- // <fini>.
- }
- }
- else // Use dynamic linking.
-
- // Run forever, performing the configured services until we are
- // shut down by a signal (e.g., SIGINT or SIGQUIT).
-
- ACE_Reactor::run_event_loop ();
-
- return 0;
-}
diff --git a/apps/Gateway/Peer/peerd.dsp b/apps/Gateway/Peer/peerd.dsp
deleted file mode 100644
index ff9a027ba2b..00000000000
--- a/apps/Gateway/Peer/peerd.dsp
+++ /dev/null
@@ -1,57 +0,0 @@
-# Microsoft Developer Studio Project File - Name="peerd" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=peerd - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "peerd.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "peerd.mak" CFG="peerd - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "peerd - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\\" /D "_CONSOLE" /D "_MBCS" /D "WIN32" /D "_DEBUG" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 Peer.lib aced.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\ace"
-# Begin Target
-
-# Name "peerd - Win32 Debug"
-# Begin Source File
-
-SOURCE=.\peerd.cpp
-# End Source File
-# End Target
-# End Project
diff --git a/apps/Gateway/Peer/svc.conf b/apps/Gateway/Peer/svc.conf
deleted file mode 100644
index c27eb06cec8..00000000000
--- a/apps/Gateway/Peer/svc.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-#static Svc_Manager "-d -p 291"
-dynamic Peer1 Service_Object * ./Peer:_make_Peer_Factory() active "-a C|S"