diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-04-09 08:27:31 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-04-09 08:27:31 +0000 |
commit | f0c080fdc364d753e4858872160be9e46c9c72ee (patch) | |
tree | 9000a3a9fd0ef9533bce2ec9ee8574bb0253ac78 | |
parent | 75c135d4ee37b69f112affec1948ef387456dce9 (diff) | |
download | ATCD-f0c080fdc364d753e4858872160be9e46c9c72ee.tar.gz |
*** empty log message ***
-rw-r--r-- | ChangeLog-97a | 15 | ||||
-rw-r--r-- | ace/Asynch_Acceptor.cpp | 11 | ||||
-rw-r--r-- | ace/Asynch_IO.cpp | 8 | ||||
-rw-r--r-- | ace/Asynch_IO.h | 6 | ||||
-rw-r--r-- | ace/config-win32-common.h | 5 | ||||
-rw-r--r-- | ace/config-win32.h | 1 |
6 files changed, 41 insertions, 5 deletions
diff --git a/ChangeLog-97a b/ChangeLog-97a index 89bb6fa9266..04967bb2fbd 100644 --- a/ChangeLog-97a +++ b/ChangeLog-97a @@ -1,8 +1,19 @@ +Wed Apr 9 03:12:24 1997 Irfan Pyarali <irfan@flamenco.cs.wustl.edu> + + * ace/config-win32-common.h: Defining _WIN32_WINNT as 0x0400 + implies ACE_HAS_WINSOCK2. + + * ace/Asynch_IO: The implementation of ACE_Asynch_Transmit_File + and ACE_Asynch_Accept are only supported if ACE_HAS_WINSOCK2 is + defined or you are on WinNT 4.0 or higher. Therefore, added + appropriate #defines. Thanks to Matthias Kerkhoff + <make@cs.tu-berlin.de> for suggesting this. + Tue Apr 8 22:45:28 1997 Prashant Jain <pjain@merengue.cs.wustl.edu> * java/src/SOCKStream.java (SOCKStream): Made two small changes to - the two send(). Instead of doing a println, I now do a - print. This was really a bug! + the two send(). Instead of doing a println, I now do a + print. This was really a bug! Tue Apr 08 22:08:12 1997 David L. Levine <levine@cs.wustl.edu> diff --git a/ace/Asynch_Acceptor.cpp b/ace/Asynch_Acceptor.cpp index 07939c729e4..9d5386ceb3c 100644 --- a/ace/Asynch_Acceptor.cpp +++ b/ace/Asynch_Acceptor.cpp @@ -4,8 +4,8 @@ #define ACE_BUILD_DLL #include "ace/Asynch_Acceptor.h" -#if defined (ACE_WIN32) -// This only works on Win32 platforms +#if defined (ACE_WIN32) +// This only works on Win32 platforms #include "ace/Message_Block.h" #include "ace/INET_Addr.h" @@ -110,6 +110,7 @@ ACE_Asynch_Acceptor<HANDLER>::accept (size_t bytes_to_read) template <class HANDLER> void ACE_Asynch_Acceptor<HANDLER>::handle_accept (const ACE_Asynch_Accept::Result &result) { +#if defined (ACE_HAS_WINSOCK2) || (_WIN32_WINNT >= 0x0400) // If the asynchronous accept succeeds if (result.success ()) { @@ -156,6 +157,7 @@ ACE_Asynch_Acceptor<HANDLER>::handle_accept (const ACE_Asynch_Accept::Result &re // Start off another asynchronous accept to keep the backlog going this->accept (this->bytes_to_read_); +#endif // defined (ACE_HAS_WINSOCK2) || (_WIN32_WINNT >= 0x0400) } template <class HANDLER> int @@ -172,6 +174,7 @@ ACE_Asynch_Acceptor<HANDLER>::parse_address (ACE_Message_Block &message_block, ACE_INET_Addr &remote_address, ACE_INET_Addr &local_address) { +#if defined (ACE_HAS_WINSOCK2) || (_WIN32_WINNT >= 0x0400) sockaddr *local_addr = 0; sockaddr *remote_addr = 0; int local_size = 0; @@ -188,6 +191,10 @@ ACE_Asynch_Acceptor<HANDLER>::parse_address (ACE_Message_Block &message_block, local_address.set_addr ((sockaddr_in *) local_addr, local_size); remote_address.set_addr ((sockaddr_in *) remote_addr, remote_size); +#else + // just in case + errno = ENOTSUP; +#endif // defined (ACE_HAS_WINSOCK2) || (_WIN32_WINNT >= 0x0400) } template <class HANDLER> ACE_HANDLE diff --git a/ace/Asynch_IO.cpp b/ace/Asynch_IO.cpp index e6c8289dac4..067810f139e 100644 --- a/ace/Asynch_IO.cpp +++ b/ace/Asynch_IO.cpp @@ -487,6 +487,7 @@ ACE_Asynch_Accept::accept (ACE_Message_Block &message_block, ACE_HANDLE accept_handle, const void *act) { +#if defined (ACE_HAS_WINSOCK2) || (_WIN32_WINNT >= 0x0400) // Sanity check: make sure that enough space has been allocated by the caller. size_t address_size = sizeof (sockaddr_in) + sizeof (sockaddr); size_t space_in_use = message_block.wr_ptr () - message_block.base (); @@ -557,6 +558,9 @@ ACE_Asynch_Accept::accept (ACE_Message_Block &message_block, ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "ReadFile"), -1); } +#else + ACE_NOTSUP_RETURN (-1); +#endif /* defined (ACE_HAS_WINSOCK2) || (_WIN32_WINNT >= 0x0400) */ } // ************************************************************ @@ -634,6 +638,7 @@ ACE_Asynch_Transmit_File::transmit_file (ACE_HANDLE file, u_long flags, const void *act) { +#if defined (ACE_HAS_WINSOCK2) || (_WIN32_WINNT >= 0x0400) Result *result = 0; ACE_NEW_RETURN (result, Result (*this->handler_, @@ -682,6 +687,9 @@ ACE_Asynch_Transmit_File::transmit_file (ACE_HANDLE file, ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "TransmitFile"), -1); } +#else + ACE_NOTSUP_RETURN (-1); +#endif /* defined (ACE_HAS_WINSOCK2) || (_WIN32_WINNT >= 0x0400) */ } // ************************************************************ diff --git a/ace/Asynch_IO.h b/ace/Asynch_IO.h index 69c735e253d..b0fcd522070 100644 --- a/ace/Asynch_IO.h +++ b/ace/Asynch_IO.h @@ -21,7 +21,11 @@ #include "ace/OS.h" #if defined (ACE_WIN32) -// This only works on Win32 platforms +// This only works on Win32 platforms. +// +// The implementation of ACE_Asynch_Transmit_File and +// ACE_Asynch_Accept are only supported if ACE_HAS_WINSOCK2 is defined +// or you are on WinNT 4.0 or higher // Forward declarations class ACE_Proactor; diff --git a/ace/config-win32-common.h b/ace/config-win32-common.h index 4eb7c47f295..921cd42217c 100644 --- a/ace/config-win32-common.h +++ b/ace/config-win32-common.h @@ -240,6 +240,11 @@ #endif /* WIN32_LEAN_AND_MEAN */ #endif /* !defined (_INC_INWDOWS) */ +// Always use WS2 when available +#if (_WIN32_WINNT >= 0x0400) + #define ACE_HAS_WINSOCK2 +#endif + #if defined (ACE_HAS_WINSOCK2) #if !defined (_WINSOCK2API_) diff --git a/ace/config-win32.h b/ace/config-win32.h index 531e74ce34f..62f448a54f1 100644 --- a/ace/config-win32.h +++ b/ace/config-win32.h @@ -14,6 +14,7 @@ // Define this if you're running NT 4.x // Setting applies to : building ACE // Runtime restrictions: System must be Windows NT > 4.0 +// Additonal notes: Defining _WIN32_WINNT as 0x0400 implies ACE_HAS_WINSOCK2. // #define _WIN32_WINNT 0x0400 // Uncomment this, if you want ACE to use CWinThread. This should |