summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-02-22 00:18:45 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-02-22 00:18:45 +0000
commitf0bf9c81fe9258869b15d7ba06453252ac64665d (patch)
treea18314a72bf1f79a83f77b8864df954fd60d996d
parent2c1882c7416d40fd95e660244f4095530368253e (diff)
downloadATCD-f0bf9c81fe9258869b15d7ba06453252ac64665d.tar.gz
foo
-rw-r--r--ChangeLog-97a37
-rw-r--r--README1
-rw-r--r--ace/OS.i28
-rw-r--r--ace/SOCK.h43
-rw-r--r--ace/Timer_Queue.cpp2
-rw-r--r--apps/Gateway/Gateway/Concrete_Proxy_Handlers.cpp10
-rw-r--r--apps/Gateway/Gateway/Event_Channel.cpp3
-rw-r--r--apps/Gateway/Gateway/Event_Channel.h3
-rw-r--r--apps/Gateway/Gateway/Gateway.cpp5
-rw-r--r--apps/Gateway/Gateway/proxy_config2
-rw-r--r--apps/Gateway/Peer/Peer.cpp25
-rw-r--r--examples/ASX/Event_Server/Event_Server/Peer_Router.cpp4
-rw-r--r--examples/ASX/Event_Server/README53
13 files changed, 137 insertions, 79 deletions
diff --git a/ChangeLog-97a b/ChangeLog-97a
index 266a6057501..7e9e82f0626 100644
--- a/ChangeLog-97a
+++ b/ChangeLog-97a
@@ -1,3 +1,15 @@
+Fri Feb 21 08:06:41 1997 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+
+ * ace/OS.i: Yikes, it looks like the Solaris and the POSIX version
+ of sigwait() are different! The Solaris version returns the
+ signal number, whereas the POSIX version returns 0 on success,
+ errno on failure, and sets a parameter with the signal on
+ success. I've fixed the ACE_OS C++ wrapper so that the right
+ thing happens, i.e., errno is always set to the error (if
+ sigwait() returns -1) and the signum is always returned as the
+ argument and the return value on success ... Thanks to Harry
+ Gunnarsson <hg@carmenta.se> for reporting this.
+
Fri Feb 21 11:01:22 1997 David L. Levine <levine@cs.wustl.edu>
* ace/Thread_Priority.cpp: fixed return type of
@@ -24,6 +36,31 @@ Fri Feb 21 04:12:31 1997 <irfan@TWOSTEP>
structured exceptions caused by user code when dispatching
handles
+Thu Feb 20 17:32:54 1997 Douglas C. Schmidt <schmidt@flamenco.cs.wustl.edu>
+
+ * apps/Gateway: Added a new -v flag to the peerd and gatewayd
+ applications so that they will print out the strings that are
+ passed to them. This makes it easier to debug and see what's
+ happening.
+
+Wed Feb 19 19:39:06 1997 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+
+ * apps/Gateway/Gateway/Concrete_Proxy_Handlers.cpp (recv): Removed
+ the VERBOSE #ifdefs since they weren't used and were causing
+ compile errors. Thanks to Bert Craytor
+ <Bert_Craytor@peoplesoft.com> for reporting this.
+
+Wed Feb 19 00:39:50 1997 Douglas C. Schmidt <schmidt@flamenco.cs.wustl.edu>
+
+ * examples/ASX/Event_Server: Updated the README file a bit to
+ clarify some loose ends. The documentation now explains
+ precisely how to start up the transceivers correctly. Thanks to
+ Patty Genuald <genualdp@agcs.com> for suggesting this.
+
+ * include/makeinclude: Removed the default symlink for
+ platform_macros.GNU since it is "Solaris-biased" ;-). Thanks to
+ Amos Shapira <amos@dsi.co.il> for reporting this.
+
Wed Feb 19 14:41:18 1997 Tim H. Harrison <harrison@lambada.cs.wustl.edu>
* ace/Reactor.cpp: Modified to use timer_queue_->gettimeofday().
diff --git a/README b/README
index a62d16de945..ce76e766523 100644
--- a/README
+++ b/README
@@ -475,6 +475,7 @@ Nigel Owen <Nigel@voicelink.co.nz>
Jorn Jensen <jornj@funcom.com>
Paul Roman <proman@npac.syr.edu>
Dave Mayerhoefer <m210229@svappl36.mdc.com>
+Bert Craytor <Bert_Craytor@peoplesoft.com>
I would particularly like to thank Paul Stephenson, who worked with me
at Ericsson and is now at ObjectSpace. Paul devised the recursive
diff --git a/ace/OS.i b/ace/OS.i
index 14039276a2e..f3f120b9ad8 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -3684,33 +3684,33 @@ ACE_INLINE int
ACE_OS::sigwait (sigset_t *set, int *sig)
{
// ACE_TRACE ("ACE_OS::sigwait");
- sig = sig;
+ int local_sig;
+ if (sig == 0)
+ sig = &local_sig;
#if defined (ACE_HAS_THREADS)
#if defined (ACE_HAS_STHREADS) || defined (ACE_HAS_FSU_PTHREADS)
- ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::sigwait (set),
- ace_result_),
- int, -1);
+ *sig = ::sigwait (set);
+ return *sig;
#elif defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS)
#if defined (ACE_HAS_SETKIND_NP) || defined (ACE_HAS_ONEARG_SIGWAIT)
- ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::sigwait (set),
- ace_result_),
- int, -1);
+ *sig = ::sigwait (set);
+ return *sig;
#else /* ACE_HAS_SETKIND_NP */
- ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::sigwait (set, sig),
- ace_result_),
- int, -1);
+ errno = ::sigwait (set, sig);
+ if (errno == -1)
+ return -1;
+ else
+ return *sig;
#endif /* ACE_HAS_SETKIND_NP */
#elif defined (ACE_HAS_WTHREADS)
ACE_UNUSED_ARG(set);
-
ACE_NOTSUP_RETURN (-1);
#elif defined (VXWORKS)
// second arg is a struct siginfo *, which we don't need (the selected
// signal number is returned)
// third arg is timeout: 0 means forever
- ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::sigtimedwait (set, 0, 0),
- ace_result_),
- int, -1); // yes, the doc says -1, not ERROR
+ *sig = ::sigtimedwait (set, 0, 0);
+ return *sig;
#endif /* ACE_HAS_STHREADS */
#else
ACE_NOTSUP_RETURN (-1);
diff --git a/ace/SOCK.h b/ace/SOCK.h
index bc2e64dc022..d2d2ac19647 100644
--- a/ace/SOCK.h
+++ b/ace/SOCK.h
@@ -1,7 +1,7 @@
/* -*- C++ -*- */
// $Id$
-// ============================================================================
+//============================================================================
//
// = LIBRARY
// ace
@@ -12,7 +12,7 @@
// = AUTHOR
// Doug Schmidt
//
-// ============================================================================
+//============================================================================
#if !defined (ACE_SOCK_H)
#define ACE_SOCK_H
@@ -23,31 +23,39 @@
class ACE_Export ACE_SOCK : public ACE_IPC_SAP
// = TITLE
- // Defines the member functions for the base class of the
- // ACE_SOCK abstraction.
+ // An abstract class which forms the basis for more specific
+ // classes (such as ACE_SOCK_Acceptor and ACE_SOCK_Connector).
+ // Do not instantiate this class.
+
+ // = This class provides functions that are common to all of the
+ // SOCK-type classes. ACE_SOCK provides the ability to get and set
+ // socket options, get the local and remote addresses, and close
+ // the socket.
+
{
public:
int set_option (int level,
- int option,
- void *optval,
- int optlen) const;
+ int option,
+ void *optval,
+ int optlen) const;
// Wrapper around the setsockopt() system call.
int get_option (int level,
- int option,
- void *optval,
- int *optlen) const;
+ int option,
+ void *optval,
+ int *optlen) const;
// Wrapper around the getsockopt() system call.
int close (void);
// Close down the socket.
int get_local_addr (ACE_Addr &) const;
- // Return the local endpoint address.
+ // Return the local endpoint address in the referenced ACE_Addr.
+ // Returns 0 if successful, else -1.
int get_remote_addr (ACE_Addr &) const;
// Return the address of the remotely connected peer (if there is
- // one).
+ // one), in the referenced ACE_Addr. Returns 0 if successful, else -1.
void dump (void) const;
// Dump the state of an object.
@@ -56,17 +64,18 @@ public:
// Declare the dynamic allocation hooks.
protected:
- // = Make this an abstract class.
+
ACE_SOCK (void);
- // Default constructor.
+ // Default constructor. It's protected to make sure no instance is
+ // instantiated.
int open (int type,
- int protocol_family,
- int protocol);
+ int protocol_family,
+ int protocol);
// Wrapper around the socket() system call.
ACE_SOCK (int type, int protocol_family, int protocol = 0);
- // Wrapper around the socket() system call.
+ // Constructor with arguments to also call the socket() system call.
#if defined (ACE_WIN32)
static ACE_SOCK dummy_;
diff --git a/ace/Timer_Queue.cpp b/ace/Timer_Queue.cpp
index 8de4bbd281e..738ea7a4263 100644
--- a/ace/Timer_Queue.cpp
+++ b/ace/Timer_Queue.cpp
@@ -53,7 +53,7 @@ ACE_Timer_Queue_Iterator::~ACE_Timer_Queue_Iterator (void)
{
}
-// Determines the maximum amount of time that the Reactor must wait
+// Determines the minimum amount of time that the Reactor must wait
// before timing out. This is computed as the smaller of (1) the
// amount the caller requested when calling handle_events() and (2)
// the earliest time registered in the Timer Queue (if any). Must be
diff --git a/apps/Gateway/Gateway/Concrete_Proxy_Handlers.cpp b/apps/Gateway/Gateway/Concrete_Proxy_Handlers.cpp
index 7f5c1d9ab6c..96d1177dc7e 100644
--- a/apps/Gateway/Gateway/Concrete_Proxy_Handlers.cpp
+++ b/apps/Gateway/Gateway/Concrete_Proxy_Handlers.cpp
@@ -339,14 +339,10 @@ Supplier_Proxy::recv (ACE_Message_Block *&forward_addr)
}
this->total_bytes (data_received + header_received);
-#if defined (VERBOSE)
- ACE_DEBUG ((LM_DEBUG, "(%t) connection id = %d, supplier id = %d, len = %d, payload = %*s",
- event_addr.proxy_id_, event->header_.supplier_id_, event->header_.len_,
- event->header_.len_, event->data_));
-#else
ACE_DEBUG ((LM_DEBUG, "(%t) supplier id = %d, cur len = %d, total bytes read = %d\n",
- event->header_.supplier_id_, event->header_.len_, data_received + header_received));
-#endif /* VERBOSE */
+ event->header_.supplier_id_, event->header_.len_, data_received + header_received));
+ if (this->event_channel_.options ().verbose_)
+ ACE_DEBUG ((LM_DEBUG, "data_ = %*s\n", event->header_.len_ - 2, event->data_));
// Encode before returning so that we can set things out in
// network byte order.
diff --git a/apps/Gateway/Gateway/Event_Channel.cpp b/apps/Gateway/Gateway/Event_Channel.cpp
index 5c2f3ee93ca..c23e57d728b 100644
--- a/apps/Gateway/Gateway/Event_Channel.cpp
+++ b/apps/Gateway/Gateway/Event_Channel.cpp
@@ -13,7 +13,8 @@ ACE_Event_Channel_Options::ACE_Event_Channel_Options (void)
threading_strategy_ (REACTIVE),
acceptor_port_ (ACE_DEFAULT_GATEWAY_SERVER_PORT),
connector_role_ (0),
- acceptor_role_ (0)
+ acceptor_role_ (0),
+ verbose_ (0)
{
}
diff --git a/apps/Gateway/Gateway/Event_Channel.h b/apps/Gateway/Gateway/Event_Channel.h
index 22dd8137147..9ef23732328 100644
--- a/apps/Gateway/Gateway/Event_Channel.h
+++ b/apps/Gateway/Gateway/Event_Channel.h
@@ -75,6 +75,9 @@ public:
int acceptor_role_;
// Enabled if we are playing the role of the Connector.
+
+ int verbose_;
+ // Enabled if we want verbose diagnostic output.
};
class ACE_Svc_Export ACE_Event_Channel : public ACE_Task<ACE_SYNCH>
diff --git a/apps/Gateway/Gateway/Gateway.cpp b/apps/Gateway/Gateway/Gateway.cpp
index f9d505a5733..867865ff0e8 100644
--- a/apps/Gateway/Gateway/Gateway.cpp
+++ b/apps/Gateway/Gateway/Gateway.cpp
@@ -98,7 +98,7 @@ Gateway::parse_args (int argc, char *argv[])
ACE_OS::strcpy (this->consumer_config_file_, "consumer_config");
this->debug_ = 0;
- ACE_Get_Opt get_opt (argc, argv, "abC:cdP:pq:t:w:", 0);
+ ACE_Get_Opt get_opt (argc, argv, "abC:cdP:pq:t:vw:", 0);
for (int c; (c = get_opt ()) != EOF; )
{
@@ -151,6 +151,9 @@ Gateway::parse_args (int argc, char *argv[])
break;
}
+ case 'v': // Verbose mode.
+ this->event_channel_.options ().verbose_ = 1;
+ break;
case 'w': // Time performance for a designated amount of time.
this->event_channel_.options ().performance_window_ =
ACE_OS::atoi (get_opt.optarg);
diff --git a/apps/Gateway/Gateway/proxy_config b/apps/Gateway/Gateway/proxy_config
index e0784e4038e..df034f543b1 100644
--- a/apps/Gateway/Gateway/proxy_config
+++ b/apps/Gateway/Gateway/proxy_config
@@ -35,7 +35,7 @@
# ID Port Role Timeout Port
# ---- -------- ------ ------ ---------- ----- --------
1 merengue.cs 10010 S 32 0 1
- 2 tango.cs 10010 C 32 0 1
+ 2 mambo.cs 10010 C 32 0 1
# 3 mambo.cs 10002 C 32 0 1
# 4 lambada.cs 10002 C 32 0 1
# 5 lambada.cs 10002 C 32 0 1
diff --git a/apps/Gateway/Peer/Peer.cpp b/apps/Gateway/Peer/Peer.cpp
index a2d98aaf35b..9d7db934427 100644
--- a/apps/Gateway/Peer/Peer.cpp
+++ b/apps/Gateway/Peer/Peer.cpp
@@ -28,6 +28,8 @@
#include "ace/INET_Addr.h"
#include "Event.h"
+static int verbose = 0;
+
// Handle Peer events arriving as events.
class Peer_Handler : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
@@ -459,14 +461,10 @@ Peer_Handler::recv (ACE_Message_Block *&mb)
this->msg_frag_ = 0;
}
-#if defined (VERBOSE)
- ACE_DEBUG ((LM_DEBUG, "(%t) connection id = %d, supplier id = %d, len = %d, payload = %*s",
- event_addr.conn_id_, event->header_.supplier_id_, event->header_.len_,
- event->header_.len_, event->data_));
-#else
ACE_DEBUG ((LM_DEBUG, "(%t) supplier id = %d, cur len = %d, total bytes read = %d\n",
event->header_.supplier_id_, event->header_.len_, data_received + header_received));
-#endif /* VERBOSE */
+ if (verbose)
+ ACE_DEBUG ((LM_DEBUG, "data_ = %*s\n", event->header_.len_ - 2, event->data_));
return data_received + header_received;
}
}
@@ -552,18 +550,14 @@ Peer_Handler::await_events (void)
Event *event = (Event *) mb->rd_ptr ();
this->total_bytes_ += mb->length ();
-#if defined (VERBOSE)
- ACE_DEBUG ((LM_DEBUG,
- "route id = %d, len = %d, payload = %*s",
- event->header_.supplier_id_, event->header_.len_,
- event->header_.len_, event->data_));
-#else
ACE_DEBUG ((LM_DEBUG,
"route id = %d, cur len = %d, total len = %d\n",
event->header_.supplier_id_,
event->header_.len_,
this->total_bytes_));
-#endif /* VERBOSE */
+ if (verbose)
+ ACE_DEBUG ((LM_DEBUG, "data_ = %s\n", event->data_));
+
mb->release ();
return 0;
}
@@ -722,7 +716,7 @@ Peer_Acceptor::fini (void)
void
Peer_Acceptor::parse_args (int argc, char *argv[])
{
- ACE_Get_Opt get_opt (argc, argv, "dp:", 0);
+ ACE_Get_Opt get_opt (argc, argv, "dp:v", 0);
for (int c; (c = get_opt ()) != -1; )
{
@@ -733,6 +727,9 @@ Peer_Acceptor::parse_args (int argc, char *argv[])
break;
case 'd':
break;
+ case 'v': // Verbose mode.
+ verbose = 1;
+ break;
default:
break;
}
diff --git a/examples/ASX/Event_Server/Event_Server/Peer_Router.cpp b/examples/ASX/Event_Server/Event_Server/Peer_Router.cpp
index 332ad520e84..cf65a7a444c 100644
--- a/examples/ASX/Event_Server/Event_Server/Peer_Router.cpp
+++ b/examples/ASX/Event_Server/Event_Server/Peer_Router.cpp
@@ -77,7 +77,9 @@ Peer_Router_Context::Peer_Router_Context (u_short port)
if (this->acceptor().get_local_addr (addr) != -1)
ACE_DEBUG ((LM_DEBUG,
- "(%t) initializing on port = %d, handle = %d, this = %u\n",
+ "(%t) initializing %s on port = %d, handle = %d, this = %u\n",
+ addr.get_port_number () == Options::instance ()->supplier_port () ?
+ "Supplier_Handler" : "Consumer_Handler",
addr.get_port_number (),
this->acceptor().get_handle (),
this));
diff --git a/examples/ASX/Event_Server/README b/examples/ASX/Event_Server/README
index 8e1342fd7bc..f54d724e1fe 100644
--- a/examples/ASX/Event_Server/README
+++ b/examples/ASX/Event_Server/README
@@ -7,38 +7,47 @@ http://www.cs.wustl.edu/~schmidt/DSEJ-94.ps.gz
The Event Server example works as follows:
1. When the ./Event_Server/event_server executable is run it
- creates two SOCK_Acceptors, which listen for and accept
- incoming connections from Consumers and Suppliers.
+ creates two SOCK_Acceptors, which listen for and accept incoming
+ connections from Consumers and Suppliers.
2. The ./Event_Server/Transceiver/transceiver application plays
- the role of Consumer and Supplier. It can be started multiple
- times. Each call should be either:
+ the role of either a Consumer or a Supplier (but with the current
+ implementation it can only play one role at a time). The
+ transceiver process can be started multiple times. Each call
+ should be either:
- % transceiver -p XYZ -h hostname
+ # Consumer
+ % transceiver -p 10002 -h hostname -C
or
- % transceiver -p ABC -h hostname
+ # Supplier
+ % transceiver -p 10003 -h hostname -S
- where XYZ and ABC are the Consumer listening port and the Supplier
- listening port, respectively, on the event server and "hostname" is
- the name of the machine the event_server is running. I typically
- run the Consumer(s) and Supplier(s) in different windows.
+ where 10002 and 10003 are the default Consumer listening port and
+ the Supplier listening port, respectively, on the event server,
+ "hostname" is the name of the machine the event_server is running,
+ and -C and -S indicate that the transceiver plays the role of a
+ Consumer or Supplier, respectively. I typically run the
+ Consumer(s) and Supplier(s) in different windows to make it easier
+ to understand the output.
-3. Once the Consumer(s) and Supplier(s) are connected, you can type
- data from any Supplier window. This data will be routed
- through the Modules/Tasks in an event_server's Stream and
- be forwarded to the Consumer(s). Note that you can also
- send messages from the Consumer(s) to Supplier(s), but the
- Event Server will warn you about this since it's not really
- kosher...
+3. Once the Consumer(s) and Supplier(s) are connected, you can
+ type data from any Supplier window. This data will be routed
+ through the Modules/Tasks in the event_server's Stream and be
+ forwarded to the Consumer(s).
+
+ Since the transceivers are full-duplex you can also send messages
+ from the Consumer(s) to Supplier(s), but the Event Server will warn
+ you about this since it's not really kosher to have Consumers
+ sending to Suppliers ;-)
4. When you want to shut down the tranceivers or event server
- just type ^C (which generates a SIGINT) or type any input
- in the window running the Event Server.
+ just type ^C (which generates a SIGINT) or type any input in the
+ window running the Event Server.
What makes this example particularly interesting is that once you've
-got the hang of this basic architecture, you can "push" new filtering
-Modules onto the event_server Stream and modify the application's
-behavior transparently.
+got the hang of the ASX Streams architecture, you can "push" new
+filtering Modules onto the event_server Stream and modify the
+application's behavior transparently.