diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-02-24 18:40:30 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-02-24 18:40:30 +0000 |
commit | af7676611676e030ce4c1c3f3cc115b86ccf36f0 (patch) | |
tree | b50340ca43c32a0d92681d91987820f07f349a8a | |
parent | 98675c8190548c2cf8be6e64c9c1a8994de3515b (diff) | |
download | ATCD-af7676611676e030ce4c1c3f3cc115b86ccf36f0.tar.gz |
foo
-rw-r--r-- | ChangeLog-97a | 16 | ||||
-rw-r--r-- | examples/Connection/non_blocking/CPP-acceptor.cpp | 7 | ||||
-rw-r--r-- | examples/Connection/non_blocking/CPP-connector.cpp | 21 | ||||
-rw-r--r-- | examples/Connection/non_blocking/test_spipe_acceptor.cpp | 9 | ||||
-rw-r--r-- | examples/Connection/non_blocking/test_spipe_connector.cpp | 10 |
5 files changed, 50 insertions, 13 deletions
diff --git a/ChangeLog-97a b/ChangeLog-97a index 9428df9c436..073a08dfd8d 100644 --- a/ChangeLog-97a +++ b/ChangeLog-97a @@ -1,3 +1,19 @@ +Mon Feb 24 11:52:08 1997 Douglas C. Schmidt <schmidt@flamenco.cs.wustl.edu> + + * examples/Connection/non_blocking/CPP-acceptor.cpp (init): Added + a #ifdef for ACE_WIN32 so that we don't register the signal + handler for SIGPIPE since it's not supported on Win32. Thanks + to Ivan Murphy <Ivan.Murphy@med.siemens.de> for reporting this + problem. + + * examples/Connection/non_blocking: The SPIPE examples in + (test_spipe_{acceptor,connector}.cpp) aren't ported to Win32 + yet. They currently don't work because ACE_SPIPE*'s can't be + registered with the ACE_Reactor (which only works with sockets). + I've #ifdef'd these examples so that they don't get compiled on + Win32. Thanks to Ivan Murphy <Ivan.Murphy@med.siemens.de> for + reporting this problem. + Sat Feb 22 23:03:45 1997 David L. Levine <levine@cs.wustl.edu> * ace/OS.i: restored version 4.89 and 4.90 changes that diff --git a/examples/Connection/non_blocking/CPP-acceptor.cpp b/examples/Connection/non_blocking/CPP-acceptor.cpp index 90898515c11..7972926a2eb 100644 --- a/examples/Connection/non_blocking/CPP-acceptor.cpp +++ b/examples/Connection/non_blocking/CPP-acceptor.cpp @@ -93,15 +93,16 @@ IPC_Server<SH, PR_AC_2>::init (int argc, char *argv[]) use_reactor ? ACE_Service_Config::reactor () : 0) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), -1); - // Handle SIGINT signal through the ACE_Reactor. + // Handle the SIGINT signal through the ACE_Reactor. else if (ACE_Service_Config::reactor ()->register_handler (SIGINT, &this->done_handler_) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "register_handler"), -1); - - // Handle SIGPIPE signal through the ACE_Reactor. +#if !defined (ACE_WIN32) + // Handle the SIGPIPE signal through the ACE_Reactor. else if (ACE_Service_Config::reactor ()->register_handler (SIGPIPE, &this->done_handler_) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "register_handler"), -1); +#endif /* ACE_WIN32 */ else return 0; } diff --git a/examples/Connection/non_blocking/CPP-connector.cpp b/examples/Connection/non_blocking/CPP-connector.cpp index 130692028f2..35c21c5e593 100644 --- a/examples/Connection/non_blocking/CPP-connector.cpp +++ b/examples/Connection/non_blocking/CPP-connector.cpp @@ -33,7 +33,8 @@ Peer_Handler<PR_ST_2>::open (void *) while (this->connected () != -1) continue; - this->handle_close (0, ACE_Event_Handler::READ_MASK); + this->handle_close (ACE_INVALID_HANDLE, + ACE_Event_Handler::READ_MASK); } return 0; } @@ -79,6 +80,7 @@ Peer_Handler<PR_ST_2>::connected (void) { if (this->peer ().close () == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), 1); + this->action_ = &Peer_Handler<PR_ST_2>::disconnecting; return -1; } @@ -191,12 +193,16 @@ IPC_Client<SH, PR_CO_2>::init (int argc, char *argv[]) this->options_.set (ACE_Synch_Options::USE_REACTOR, timeout); + SH *sh; + + ACE_NEW_RETURN (sh, SH (this->reactor ()), -1) + // Connect to the peer, reusing the local addr if necessary. - if (this->connect (new SH (this->reactor ()), remote_addr, - this->options_, local_addr, 1) == -1 - && errno != EWOULDBLOCK) + if (this->connect (sh, remote_addr, this->options_, local_addr, 1) == -1 + && errno != EWOULDBLOCK) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "connect"), -1); - return 0; + else + return 0; } template <class SH, PR_CO_1> @@ -208,10 +214,11 @@ template <class SH, PR_CO_1> int IPC_Client<SH, PR_CO_2>::handle_close (ACE_HANDLE h, ACE_Reactor_Mask) { - if (h >= 0) + if (h == ACE_INVALID_HANDLE) ACE_ERROR ((LM_ERROR, "%p on %d\n", "connection failed", h)); - else // We are closing down the connector. + else { + // We are closing down the connector. ACE_DEBUG ((LM_DEBUG, "closing down IPC_Client\n")); this->inherited::handle_close (); } diff --git a/examples/Connection/non_blocking/test_spipe_acceptor.cpp b/examples/Connection/non_blocking/test_spipe_acceptor.cpp index a0a3471438f..4739bd3f2e3 100644 --- a/examples/Connection/non_blocking/test_spipe_acceptor.cpp +++ b/examples/Connection/non_blocking/test_spipe_acceptor.cpp @@ -1,11 +1,11 @@ // ACE_SPIPE Server. // $Id$ - #include "ace/SPIPE_Acceptor.h" #include "ace/SPIPE_Addr.h" #include "CPP-acceptor.h" +#if !defined (ACE_WIN32) typedef Svc_Handler<ACE_SPIPE_STREAM> SVC_HANDLER; typedef IPC_Server<SVC_HANDLER, ACE_SPIPE_ACCEPTOR> IPC_SERVER; @@ -22,4 +22,11 @@ main (int argc, char *argv[]) return peer_acceptor.svc (); } +#else +int +main (void) +{ + ACE_ERROR_RETURN ((LM_ERROR, "This test is not ported to Win32 (yet)\n"), -1); +} +#endif /* !ACE_WIN32 */ diff --git a/examples/Connection/non_blocking/test_spipe_connector.cpp b/examples/Connection/non_blocking/test_spipe_connector.cpp index 947fd1592c4..94c1527a7d3 100644 --- a/examples/Connection/non_blocking/test_spipe_connector.cpp +++ b/examples/Connection/non_blocking/test_spipe_connector.cpp @@ -1,11 +1,11 @@ // ACE_SPIPE Client. // $Id$ - #include "ace/SPIPE_Connector.h" #include "ace/SPIPE_Addr.h" #include "CPP-connector.h" +#if !defined (ACE_WIN32) typedef Peer_Handler<ACE_SPIPE_STREAM> PEER_HANDLER; typedef IPC_Client<PEER_HANDLER, ACE_SPIPE_CONNECTOR> IPC_CLIENT; @@ -22,4 +22,10 @@ main (int argc, char *argv[]) return peer_connector.svc (); } - +#else +int +main (void) +{ + ACE_ERROR_RETURN ((LM_ERROR, "This test is not ported to Win32 (yet)\n"), -1); +} +#endif /* !ACE_WIN32 */ |