summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-02-16 17:23:32 +0000
committeralex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-02-16 17:23:32 +0000
commitd31c1a7d1ce5cb367f81151e56e578407fc77d58 (patch)
tree5504e93b6e75bb6adf324f8a0a3ebc41f58c937d
parent4eb5f7d29e019340ba2008f661900be986244313 (diff)
downloadATCD-d31c1a7d1ce5cb367f81151e56e578407fc77d58.tar.gz
Added these files also
-rw-r--r--ace/WIN32_Asynch_IO.cpp1577
-rw-r--r--ace/WIN32_Asynch_IO.h1154
-rw-r--r--ace/WIN32_Asynch_IO.i2
-rw-r--r--ace/ace_dll.dsp97
-rw-r--r--ace/ace_lib.dsp169
5 files changed, 2947 insertions, 52 deletions
diff --git a/ace/WIN32_Asynch_IO.cpp b/ace/WIN32_Asynch_IO.cpp
new file mode 100644
index 00000000000..6fe817dff6b
--- /dev/null
+++ b/ace/WIN32_Asynch_IO.cpp
@@ -0,0 +1,1577 @@
+// $Id$
+
+#define ACE_BUILD_DLL
+
+#include "ace/WIN32_Asynch_IO.h"
+
+// ACE_RCSID(ace, Asynch_IO, "$Id$")
+
+#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE))
+
+#include "ace/WIN32_Proactor.h"
+#include "ace/Message_Block.h"
+#include "ace/Service_Config.h"
+#include "ace/INET_Addr.h"
+#include "ace/Task_T.h"
+
+#if !defined (__ACE_INLINE__)
+#include "ace/WIN32_Asynch_IO.i"
+#endif /* __ACE_INLINE__ */
+
+u_long
+ACE_WIN32_Asynch_Result::bytes_transferred (void) const
+{
+ return this->bytes_transferred_;
+}
+
+const void *
+ACE_WIN32_Asynch_Result::act (void) const
+{
+ return this->act_;
+}
+
+int
+ACE_WIN32_Asynch_Result::success (void) const
+{
+ return this->success_;
+}
+
+const void *
+ACE_WIN32_Asynch_Result::completion_key (void) const
+{
+ return this->completion_key_;
+}
+
+u_long
+ACE_WIN32_Asynch_Result::error (void) const
+{
+ return this->error_;
+}
+
+ACE_HANDLE
+ACE_WIN32_Asynch_Result::event (void) const
+{
+ return this->hEvent;
+}
+
+u_long
+ACE_WIN32_Asynch_Result::offset (void) const
+{
+ return this->Offset;
+}
+
+u_long
+ACE_WIN32_Asynch_Result::offset_high (void) const
+{
+ return this->OffsetHigh;
+}
+
+int
+ACE_WIN32_Asynch_Result::priority (void) const
+{
+ ACE_NOTSUP_RETURN (0);
+}
+
+ACE_WIN32_Asynch_Result::~ACE_WIN32_Asynch_Result (void)
+{
+}
+
+ACE_WIN32_Asynch_Result::ACE_WIN32_Asynch_Result (ACE_Handler &handler,
+ const void* act,
+ ACE_HANDLE event,
+ u_long offset,
+ u_long offset_high,
+ int priority)
+ : ACE_Asynch_Result_Impl (),
+ OVERLAPPED (),
+ handler_ (handler),
+ act_ (act),
+ bytes_transferred_ (0),
+ success_ (0),
+ completion_key_ (0),
+ error_ (0)
+{
+ // Set the ACE_OVERLAPPED structure
+ this->Internal = 0;
+ this->InternalHigh = 0;
+ this->Offset = offset;
+ this->OffsetHigh = offset_high;
+ this->hEvent = event;
+
+ ACE_UNUSED_ARG (priority);
+}
+
+// ****************************************************************
+
+int
+ACE_WIN32_Asynch_Operation::open (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ const void *completion_key,
+ ACE_Proactor *proactor)
+{
+ this->proactor_ = proactor;
+ this->handler_ = &handler;
+ this->handle_ = handle;
+
+ // Grab the handle from the <handler> if <handle> is invalid
+ if (this->handle_ == ACE_INVALID_HANDLE)
+ this->handle_ = this->handler_->handle ();
+ if (this->handle_ == ACE_INVALID_HANDLE)
+ return -1;
+
+ // Register with the <proactor>.
+ return this->win32_proactor_->register_handle (this->handle_,
+ completion_key);
+}
+
+int
+ACE_WIN32_Asynch_Operation::cancel (void)
+{
+#if (defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) && (defined (_MSC_VER) && (_MSC_VER > 1020))
+ // All I/O operations that are canceled will complete with the error
+ // ERROR_OPERATION_ABORTED. All completion notifications for the I/O
+ // operations will occur normally.
+
+ return (int) ::CancelIo (this->handle_);
+
+#else /* Not ACE_HAS_WINNT4 && ACE_HAS_WINNT4!=0 && _MSC... */
+
+ ACE_NOTSUP_RETURN (-1);
+
+#endif /* ACE_HAS_AIO_CALLS */
+}
+
+ACE_Proactor *
+ACE_WIN32_Asynch_Operation::proactor (void) const
+{
+ return this->proactor_;
+}
+
+ACE_WIN32_Asynch_Operation::ACE_WIN32_Asynch_Operation (ACE_WIN32_Proactor *win32_proactor)
+ : ACE_Asynch_Operation_Impl (),
+ win32_proactor_ (win32_proactor),
+ proactor_ (0),
+ handler_ (0),
+ handle_ (ACE_INVALID_HANDLE)
+{
+}
+
+ACE_WIN32_Asynch_Operation::~ACE_WIN32_Asynch_Operation (void)
+{
+}
+
+// ************************************************************
+
+u_long
+ACE_WIN32_Asynch_Read_Stream_Result::bytes_to_read (void) const
+{
+ return this->bytes_to_read_;
+}
+
+ACE_Message_Block &
+ACE_WIN32_Asynch_Read_Stream_Result::message_block (void) const
+{
+ return this->message_block_;
+}
+
+ACE_HANDLE
+ACE_WIN32_Asynch_Read_Stream_Result::handle (void) const
+{
+ return this->handle_;
+}
+
+ACE_WIN32_Asynch_Read_Stream_Result::ACE_WIN32_Asynch_Read_Stream_Result (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ ACE_Message_Block &message_block,
+ u_long bytes_to_read,
+ const void* act,
+ ACE_HANDLE event,
+ int priority)
+ : ACE_Asynch_Result_Impl (),
+ ACE_Asynch_Read_Stream_Result_Impl (),
+ ACE_WIN32_Asynch_Result (handler, act, event, 0, 0, priority),
+ bytes_to_read_ (bytes_to_read),
+ message_block_ (message_block),
+ handle_ (handle)
+{
+}
+
+void
+ACE_WIN32_Asynch_Read_Stream_Result::complete (u_long bytes_transferred,
+ int success,
+ const void *completion_key,
+ u_long error)
+{
+ // Copy the data which was returned by GetQueuedCompletionStatus
+ this->bytes_transferred_ = bytes_transferred;
+ this->success_ = success;
+ this->completion_key_ = completion_key;
+ this->error_ = error;
+
+ // Appropriately move the pointers in the message block.
+ this->message_block_.wr_ptr (bytes_transferred);
+
+ // Create the interface result class.
+ ACE_Asynch_Read_Stream::Result result (this);
+
+ // Call the application handler.
+ this->handler_.handle_read_stream (result);
+}
+
+ACE_WIN32_Asynch_Read_Stream_Result::~ACE_WIN32_Asynch_Read_Stream_Result (void)
+{
+}
+
+// Base class operations. These operations are here to kill some
+// warnings. These methods call the base class methods.
+
+u_long
+ACE_WIN32_Asynch_Read_Stream_Result::bytes_transferred (void) const
+{
+ return ACE_WIN32_Asynch_Result::bytes_transferred ();
+}
+
+const void *
+ACE_WIN32_Asynch_Read_Stream_Result::act (void) const
+{
+ return ACE_WIN32_Asynch_Result::act ();
+}
+
+int
+ACE_WIN32_Asynch_Read_Stream_Result::success (void) const
+{
+ return ACE_WIN32_Asynch_Result::success ();
+}
+
+const void *
+ACE_WIN32_Asynch_Read_Stream_Result::completion_key (void) const
+{
+ return ACE_WIN32_Asynch_Result::completion_key ();
+}
+
+u_long
+ACE_WIN32_Asynch_Read_Stream_Result::error (void) const
+{
+ return ACE_WIN32_Asynch_Result::error ();
+}
+
+ACE_HANDLE
+ACE_WIN32_Asynch_Read_Stream_Result::event (void) const
+{
+ return ACE_WIN32_Asynch_Result::event ();
+}
+
+u_long
+ACE_WIN32_Asynch_Read_Stream_Result::offset (void) const
+{
+ return ACE_WIN32_Asynch_Result::offset ();
+}
+
+u_long
+ACE_WIN32_Asynch_Read_Stream_Result::offset_high (void) const
+{
+ return ACE_WIN32_Asynch_Result::offset_high ();
+}
+
+int
+ACE_WIN32_Asynch_Read_Stream_Result::priority (void) const
+{
+ return ACE_WIN32_Asynch_Result::priority ();
+}
+
+// ********************************************************************
+
+ACE_WIN32_Asynch_Read_Stream::ACE_WIN32_Asynch_Read_Stream (ACE_WIN32_Proactor *win32_proactor)
+ : ACE_Asynch_Operation_Impl (),
+ ACE_Asynch_Read_Stream_Impl (),
+ ACE_WIN32_Asynch_Operation (win32_proactor)
+{
+}
+
+int
+ACE_WIN32_Asynch_Read_Stream::read (ACE_Message_Block &message_block,
+ u_long bytes_to_read,
+ const void *act,
+ int priority)
+{
+ // Create the Asynch_Result.
+ ACE_WIN32_Asynch_Read_Stream_Result *result = 0;
+ ACE_NEW_RETURN (result,
+ ACE_WIN32_Asynch_Read_Stream_Result (*this->handler_,
+ this->handle_,
+ message_block,
+ bytes_to_read,
+ act,
+ this->win32_proactor_->get_handle (),
+ priority),
+ -1);
+
+ // Shared read
+ ssize_t return_val = this->shared_read (result);
+
+ // Upon errors
+ if (return_val == -1)
+ delete result;
+
+ return return_val;
+}
+
+ACE_WIN32_Asynch_Read_Stream::~ACE_WIN32_Asynch_Read_Stream (void)
+{
+}
+
+int
+ACE_WIN32_Asynch_Read_Stream::shared_read (ACE_WIN32_Asynch_Read_Stream_Result *result)
+{
+ u_long bytes_read;
+
+ // Initiate the read
+ int initiate_result = ::ReadFile (result->handle (),
+ result->message_block ().wr_ptr (),
+ result->bytes_to_read (),
+ &bytes_read,
+ result);
+ if (initiate_result == 1)
+ // Immediate success: the OVERLAPPED will still get queued.
+ return 1;
+
+ // If initiate failed, check for a bad error.
+ errno = ::GetLastError ();
+ switch (errno)
+ {
+ case ERROR_IO_PENDING:
+ // The IO will complete proactively: the OVERLAPPED will still
+ // get queued.
+ return 0;
+
+ default:
+ // Something else went wrong: the OVERLAPPED will not get
+ // queued.
+
+ // Cleanup dynamically allocated Asynch_Result
+ delete result;
+
+ // Return error
+ ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ReadFile")), -1);
+ }
+}
+
+// Methods belong to ACE_WIN32_Asynch_Operation base class. These
+// methods are defined here to avoid VC++ warnings. They route the
+// call to the ACE_WIN32_Asynch_Operation base class.
+
+int
+ACE_WIN32_Asynch_Read_Stream::open (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ const void *completion_key,
+ ACE_Proactor *proactor)
+{
+ return ACE_WIN32_Asynch_Operation::open (handler,
+ handle,
+ completion_key,
+ proactor);
+}
+
+int
+ACE_WIN32_Asynch_Read_Stream::cancel (void)
+{
+ return ACE_WIN32_Asynch_Operation::cancel ();
+}
+
+ACE_Proactor *
+ACE_WIN32_Asynch_Read_Stream::proactor (void) const
+{
+ return ACE_WIN32_Asynch_Operation::proactor ();
+}
+
+
+// ************************************************************
+
+u_long
+ACE_WIN32_Asynch_Write_Stream_Result::bytes_to_write (void) const
+{
+ return this->bytes_to_write_;
+}
+
+ACE_Message_Block &
+ACE_WIN32_Asynch_Write_Stream_Result::message_block (void) const
+{
+ return this->message_block_;
+}
+
+ACE_HANDLE
+ACE_WIN32_Asynch_Write_Stream_Result::handle (void) const
+{
+ return this->handle_;
+}
+
+ACE_WIN32_Asynch_Write_Stream_Result::ACE_WIN32_Asynch_Write_Stream_Result (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ ACE_Message_Block &message_block,
+ u_long bytes_to_write,
+ const void* act,
+ ACE_HANDLE event,
+ int priority)
+ : ACE_Asynch_Result_Impl (),
+ ACE_Asynch_Write_Stream_Result_Impl (),
+ ACE_WIN32_Asynch_Result (handler, act, event, 0, 0, priority),
+ bytes_to_write_ (bytes_to_write),
+ message_block_ (message_block),
+ handle_ (handle)
+{
+}
+
+void
+ACE_WIN32_Asynch_Write_Stream_Result::complete (u_long bytes_transferred,
+ int success,
+ const void *completion_key,
+ u_long error)
+{
+ // Copy the data which was returned by GetQueuedCompletionStatus
+ this->bytes_transferred_ = bytes_transferred;
+ this->success_ = success;
+ this->completion_key_ = completion_key;
+ this->error_ = error;
+
+ // Appropriately move the pointers in the message block.
+ this->message_block_.rd_ptr (bytes_transferred);
+
+ // Create the interface result class.
+ ACE_Asynch_Write_Stream::Result result (this);
+
+ // Call the application handler.
+ this->handler_.handle_write_stream (result);
+}
+
+ACE_WIN32_Asynch_Write_Stream_Result::~ACE_WIN32_Asynch_Write_Stream_Result (void)
+{
+}
+
+// Base class operations. These operations are here to kill some
+// warnings. These methods call the base class methods.
+
+u_long
+ACE_WIN32_Asynch_Write_Stream_Result::bytes_transferred (void) const
+{
+ return ACE_WIN32_Asynch_Result::bytes_transferred ();
+}
+
+const void *
+ACE_WIN32_Asynch_Write_Stream_Result::act (void) const
+{
+ return ACE_WIN32_Asynch_Result::act ();
+}
+
+int
+ACE_WIN32_Asynch_Write_Stream_Result::success (void) const
+{
+ return ACE_WIN32_Asynch_Result::success ();
+}
+
+const void *
+ACE_WIN32_Asynch_Write_Stream_Result::completion_key (void) const
+{
+ return ACE_WIN32_Asynch_Result::completion_key ();
+}
+
+u_long
+ACE_WIN32_Asynch_Write_Stream_Result::error (void) const
+{
+ return ACE_WIN32_Asynch_Result::error ();
+}
+
+ACE_HANDLE
+ACE_WIN32_Asynch_Write_Stream_Result::event (void) const
+{
+ return ACE_WIN32_Asynch_Result::event ();
+}
+
+u_long
+ACE_WIN32_Asynch_Write_Stream_Result::offset (void) const
+{
+ return ACE_WIN32_Asynch_Result::offset ();
+}
+
+u_long
+ACE_WIN32_Asynch_Write_Stream_Result::offset_high (void) const
+{
+ return ACE_WIN32_Asynch_Result::offset_high ();
+}
+
+int
+ACE_WIN32_Asynch_Write_Stream_Result::priority (void) const
+{
+ return ACE_WIN32_Asynch_Result::priority ();
+}
+
+
+// ********************************************************************
+
+ACE_WIN32_Asynch_Write_Stream::ACE_WIN32_Asynch_Write_Stream (ACE_WIN32_Proactor *win32_proactor)
+ : ACE_Asynch_Operation_Impl (),
+ ACE_Asynch_Write_Stream_Impl (),
+ ACE_WIN32_Asynch_Operation (win32_proactor)
+{
+}
+
+int
+ACE_WIN32_Asynch_Write_Stream::write (ACE_Message_Block &message_block,
+ u_long bytes_to_write,
+ const void *act,
+ int priority)
+{
+ ACE_WIN32_Asynch_Write_Stream_Result *result = 0;
+ ACE_NEW_RETURN (result,
+ ACE_WIN32_Asynch_Write_Stream_Result (*this->handler_,
+ this->handle_,
+ message_block,
+ bytes_to_write,
+ act,
+ this->win32_proactor_->get_handle (),
+ priority),
+ -1);
+
+ // Shared write
+ ssize_t return_val = this->shared_write (result);
+
+ // Upon errors
+ if (return_val == -1)
+ delete result;
+
+ return return_val;
+}
+
+ACE_WIN32_Asynch_Write_Stream::~ACE_WIN32_Asynch_Write_Stream (void)
+{
+}
+
+int
+ACE_WIN32_Asynch_Write_Stream::shared_write (ACE_WIN32_Asynch_Write_Stream_Result *result)
+{
+ u_long bytes_written;
+
+ // Initiate the write
+ int initiate_result = ::WriteFile (result->handle (),
+ result->message_block ().rd_ptr (),
+ result->bytes_to_write (),
+ &bytes_written,
+ result);
+ if (initiate_result == 1)
+ // Immediate success: the OVERLAPPED will still get queued.
+ return 1;
+
+ // If initiate failed, check for a bad error.
+ errno = ::GetLastError ();
+ switch (errno)
+ {
+ case ERROR_IO_PENDING:
+ // The IO will complete proactively: the OVERLAPPED will still
+ // get queued.
+ return 0;
+
+ default:
+ // Something else went wrong: the OVERLAPPED will not get
+ // queued.
+
+ // Cleanup dynamically allocated Asynch_Result
+ delete result;
+
+ // Return error
+ ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("WriteFile")), -1);
+ }
+}
+
+// Methods belong to ACE_WIN32_Asynch_Operation base class. These
+// methods are defined here to avoid VC++ warnings. They route the
+// call to the ACE_WIN32_Asynch_Operation base class.
+
+int
+ACE_WIN32_Asynch_Write_Stream::open (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ const void *completion_key,
+ ACE_Proactor *proactor)
+{
+ return ACE_WIN32_Asynch_Operation::open (handler,
+ handle,
+ completion_key,
+ proactor);
+}
+
+int
+ACE_WIN32_Asynch_Write_Stream::cancel (void)
+{
+ return ACE_WIN32_Asynch_Operation::cancel ();
+}
+
+ACE_Proactor *
+ACE_WIN32_Asynch_Write_Stream::proactor (void) const
+{
+ return ACE_WIN32_Asynch_Operation::proactor ();
+}
+
+// ************************************************************
+
+ACE_WIN32_Asynch_Read_File_Result::ACE_WIN32_Asynch_Read_File_Result (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ ACE_Message_Block &message_block,
+ u_long bytes_to_read,
+ const void* act,
+ u_long offset,
+ u_long offset_high,
+ ACE_HANDLE event,
+ int priority)
+ : ACE_Asynch_Result_Impl (),
+ ACE_Asynch_Read_Stream_Result_Impl (),
+ ACE_Asynch_Read_File_Result_Impl (),
+ ACE_WIN32_Asynch_Result (handler, act, event, 0, 0, priority),
+ ACE_WIN32_Asynch_Read_Stream_Result (handler,
+ handle,
+ message_block,
+ bytes_to_read,
+ act,
+ event,
+ priority)
+{
+ this->Offset = offset;
+ this->OffsetHigh = offset_high;
+}
+
+void
+ACE_WIN32_Asynch_Read_File_Result::complete (u_long bytes_transferred,
+ int success,
+ const void *completion_key,
+ u_long error)
+{
+ // Copy the data which was returned by GetQueuedCompletionStatus.
+ this->bytes_transferred_ = bytes_transferred;
+ this->success_ = success;
+ this->completion_key_ = completion_key;
+ this->error_ = error;
+
+ // Appropriately move the pointers in the message block.
+ this->message_block_.wr_ptr (bytes_transferred);
+
+ // Create the interface result class.
+ ACE_Asynch_Read_File::Result result (this);
+
+ // Call the application handler.
+ this->handler_.handle_read_file (result);
+}
+
+ACE_WIN32_Asynch_Read_File_Result::~ACE_WIN32_Asynch_Read_File_Result (void)
+{
+}
+
+// Base class operations. These operations are here to kill some
+// warnings. These methods call the base class methods.
+
+u_long
+ACE_WIN32_Asynch_Read_File_Result::bytes_transferred (void) const
+{
+ return ACE_WIN32_Asynch_Result::bytes_transferred ();
+}
+
+const void *
+ACE_WIN32_Asynch_Read_File_Result::act (void) const
+{
+ return ACE_WIN32_Asynch_Result::act ();
+}
+
+int
+ACE_WIN32_Asynch_Read_File_Result::success (void) const
+{
+ return ACE_WIN32_Asynch_Result::success ();
+}
+
+const void *
+ACE_WIN32_Asynch_Read_File_Result::completion_key (void) const
+{
+ return ACE_WIN32_Asynch_Result::completion_key ();
+}
+
+u_long
+ACE_WIN32_Asynch_Read_File_Result::error (void) const
+{
+ return ACE_WIN32_Asynch_Result::error ();
+}
+
+ACE_HANDLE
+ACE_WIN32_Asynch_Read_File_Result::event (void) const
+{
+ return ACE_WIN32_Asynch_Result::event ();
+}
+
+u_long
+ACE_WIN32_Asynch_Read_File_Result::offset (void) const
+{
+ return ACE_WIN32_Asynch_Result::offset ();
+}
+
+u_long
+ACE_WIN32_Asynch_Read_File_Result::offset_high (void) const
+{
+ return ACE_WIN32_Asynch_Result::offset_high ();
+}
+
+int
+ACE_WIN32_Asynch_Read_File_Result::priority (void) const
+{
+ return ACE_WIN32_Asynch_Result::priority ();
+}
+
+// The following methods belong to
+// ACE_WIN32_Asynch_Read_Stream_Result. They are here to avoid VC++
+// warnings. These methods route their call to the
+// ACE_WIN32_Asynch_Read_Stream_Result base class.
+
+u_long
+ACE_WIN32_Asynch_Read_File_Result::bytes_to_read (void) const
+{
+ return ACE_WIN32_Asynch_Read_Stream_Result::bytes_to_read ();
+}
+
+ACE_Message_Block &
+ACE_WIN32_Asynch_Read_File_Result::message_block (void) const
+{
+ return ACE_WIN32_Asynch_Read_Stream_Result::message_block ();
+}
+
+ACE_HANDLE
+ACE_WIN32_Asynch_Read_File_Result::handle (void) const
+{
+ return ACE_WIN32_Asynch_Read_Stream_Result::handle ();
+}
+
+// ************************************************************
+
+ACE_WIN32_Asynch_Read_File::ACE_WIN32_Asynch_Read_File (ACE_WIN32_Proactor *win32_proactor)
+ : ACE_Asynch_Operation_Impl (),
+ ACE_Asynch_Read_Stream_Impl (),
+ ACE_Asynch_Read_File_Impl (),
+ ACE_WIN32_Asynch_Read_Stream (win32_proactor)
+{
+}
+
+int
+ACE_WIN32_Asynch_Read_File::read (ACE_Message_Block &message_block,
+ u_long bytes_to_read,
+ u_long offset,
+ u_long offset_high,
+ const void *act,
+ int priority)
+{
+ ACE_WIN32_Asynch_Read_File_Result *result = 0;
+ ACE_NEW_RETURN (result,
+ ACE_WIN32_Asynch_Read_File_Result (*this->handler_,
+ this->handle_,
+ message_block,
+ bytes_to_read,
+ act,
+ offset,
+ offset_high,
+ this->win32_proactor_->get_handle (),
+ priority),
+ -1);
+
+ // Shared read
+ ssize_t return_val = this->shared_read (result);
+
+ // Upon errors
+ if (return_val == -1)
+ delete result;
+
+ return return_val;
+}
+
+ACE_WIN32_Asynch_Read_File::~ACE_WIN32_Asynch_Read_File (void)
+{
+}
+
+int
+ACE_WIN32_Asynch_Read_File::read (ACE_Message_Block &message_block,
+ u_long bytes_to_read,
+ const void *act,
+ int priority)
+{
+ return ACE_WIN32_Asynch_Read_Stream::read (message_block,
+ bytes_to_read,
+ act,
+ priority);
+}
+
+// Methods belong to ACE_WIN32_Asynch_Operation base class. These
+// methods are defined here to avoid VC++ warnings. They route the
+// call to the ACE_WIN32_Asynch_Operation base class.
+
+int
+ACE_WIN32_Asynch_Read_File::open (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ const void *completion_key,
+ ACE_Proactor *proactor)
+{
+ return ACE_WIN32_Asynch_Operation::open (handler,
+ handle,
+ completion_key,
+ proactor);
+}
+
+int
+ACE_WIN32_Asynch_Read_File::cancel (void)
+{
+ return ACE_WIN32_Asynch_Operation::cancel ();
+}
+
+ACE_Proactor *
+ACE_WIN32_Asynch_Read_File::proactor (void) const
+{
+ return ACE_WIN32_Asynch_Operation::proactor ();
+}
+
+// ************************************************************
+
+ACE_WIN32_Asynch_Write_File_Result::ACE_WIN32_Asynch_Write_File_Result (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ ACE_Message_Block &message_block,
+ u_long bytes_to_write,
+ const void* act,
+ u_long offset,
+ u_long offset_high,
+ ACE_HANDLE event,
+ int priority)
+ : ACE_Asynch_Result_Impl (),
+ ACE_Asynch_Write_Stream_Result_Impl (),
+ ACE_Asynch_Write_File_Result_Impl (),
+ ACE_WIN32_Asynch_Write_Stream_Result (handler,
+ handle,
+ message_block,
+ bytes_to_write,
+ act,
+ event,
+ priority)
+{
+ this->Offset = offset;
+ this->OffsetHigh = offset_high;
+}
+
+void
+ACE_WIN32_Asynch_Write_File_Result::complete (u_long bytes_transferred,
+ int success,
+ const void *completion_key,
+ u_long error)
+{
+ // Copy the data which was returned by GetQueuedCompletionStatus
+ this->bytes_transferred_ = bytes_transferred;
+ this->success_ = success;
+ this->completion_key_ = completion_key;
+ this->error_ = error;
+
+ // Appropriately move the pointers in the message block.
+ this->message_block_.rd_ptr (bytes_transferred);
+
+ // Create the interface result class.
+ ACE_Asynch_Write_File::Result result (this);
+
+ // Call the application handler.
+ this->handler_.handle_write_file (result);
+}
+
+ACE_WIN32_Asynch_Write_File_Result::~ACE_WIN32_Asynch_Write_File_Result (void)
+{
+}
+
+// Base class operations. These operations are here to kill some
+// warnings. These methods call the base class methods.
+
+u_long
+ACE_WIN32_Asynch_Write_File_Result::bytes_transferred (void) const
+{
+ return ACE_WIN32_Asynch_Result::bytes_transferred ();
+}
+
+const void *
+ACE_WIN32_Asynch_Write_File_Result::act (void) const
+{
+ return ACE_WIN32_Asynch_Result::act ();
+}
+
+int
+ACE_WIN32_Asynch_Write_File_Result::success (void) const
+{
+ return ACE_WIN32_Asynch_Result::success ();
+}
+
+const void *
+ACE_WIN32_Asynch_Write_File_Result::completion_key (void) const
+{
+ return ACE_WIN32_Asynch_Result::completion_key ();
+}
+
+u_long
+ACE_WIN32_Asynch_Write_File_Result::error (void) const
+{
+ return ACE_WIN32_Asynch_Result::error ();
+}
+
+ACE_HANDLE
+ACE_WIN32_Asynch_Write_File_Result::event (void) const
+{
+ return ACE_WIN32_Asynch_Result::event ();
+}
+
+u_long
+ACE_WIN32_Asynch_Write_File_Result::offset (void) const
+{
+ return ACE_WIN32_Asynch_Result::offset ();
+}
+
+u_long
+ACE_WIN32_Asynch_Write_File_Result::offset_high (void) const
+{
+ return ACE_WIN32_Asynch_Result::offset_high ();
+}
+
+int
+ACE_WIN32_Asynch_Write_File_Result::priority (void) const
+{
+ return ACE_WIN32_Asynch_Result::priority ();
+}
+
+// The following methods belong to
+// ACE_WIN32_Asynch_Write_Stream_Result. They are here to avoid VC++
+// warnings. These methods route their call to the
+// ACE_WIN32_Asynch_Write_Stream_Result base class.
+
+u_long
+ACE_WIN32_Asynch_Write_File_Result::bytes_to_write (void) const
+{
+ return ACE_WIN32_Asynch_Write_Stream_Result::bytes_to_write ();
+}
+
+ACE_Message_Block &
+ACE_WIN32_Asynch_Write_File_Result::message_block (void) const
+{
+ return ACE_WIN32_Asynch_Write_Stream_Result::message_block ();
+}
+
+ACE_HANDLE
+ACE_WIN32_Asynch_Write_File_Result::handle (void) const
+{
+ return ACE_WIN32_Asynch_Write_Stream_Result::handle ();
+}
+
+
+// ************************************************************
+
+ACE_WIN32_Asynch_Write_File::ACE_WIN32_Asynch_Write_File (ACE_WIN32_Proactor *win32_proactor)
+ : ACE_Asynch_Operation_Impl (),
+ ACE_Asynch_Write_Stream_Impl (),
+ ACE_Asynch_Write_File_Impl (),
+ ACE_WIN32_Asynch_Write_Stream (win32_proactor)
+{
+}
+
+int
+ACE_WIN32_Asynch_Write_File::write (ACE_Message_Block &message_block,
+ u_long bytes_to_write,
+ u_long offset,
+ u_long offset_high,
+ const void *act,
+ int priority)
+{
+ ACE_WIN32_Asynch_Write_File_Result *result = 0;
+ ACE_NEW_RETURN (result,
+ ACE_WIN32_Asynch_Write_File_Result (*this->handler_,
+ this->handle_,
+ message_block,
+ bytes_to_write,
+ act,
+ offset,
+ offset_high,
+ this->win32_proactor_->get_handle (),
+ priority),
+ -1);
+
+ // Shared write
+ ssize_t return_val = this->shared_write (result);
+
+ // Upon errors
+ if (return_val == -1)
+ delete result;
+
+ return return_val;
+}
+
+ACE_WIN32_Asynch_Write_File::~ACE_WIN32_Asynch_Write_File (void)
+{
+}
+
+int
+ACE_WIN32_Asynch_Write_File::write (ACE_Message_Block &message_block,
+ u_long bytes_to_write,
+ const void *act,
+ int priority)
+{
+ return ACE_WIN32_Asynch_Write_Stream::write (message_block,
+ bytes_to_write,
+ act,
+ priority);
+}
+
+// Methods belong to ACE_WIN32_Asynch_Operation base class. These
+// methods are defined here to avoid VC++ warnings. They route the
+// call to the ACE_WIN32_Asynch_Operation base class.
+
+int
+ACE_WIN32_Asynch_Write_File::open (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ const void *completion_key,
+ ACE_Proactor *proactor)
+{
+ return ACE_WIN32_Asynch_Operation::open (handler,
+ handle,
+ completion_key,
+ proactor);
+}
+
+int
+ACE_WIN32_Asynch_Write_File::cancel (void)
+{
+ return ACE_WIN32_Asynch_Operation::cancel ();
+}
+
+ACE_Proactor *
+ACE_WIN32_Asynch_Write_File::proactor (void) const
+{
+ return ACE_WIN32_Asynch_Operation::proactor ();
+}
+
+// ************************************************************
+
+u_long
+ACE_WIN32_Asynch_Accept_Result::bytes_to_read (void) const
+{
+ return this->bytes_to_read_;
+}
+
+ACE_Message_Block &
+ACE_WIN32_Asynch_Accept_Result::message_block (void) const
+{
+ return this->message_block_;
+}
+
+ACE_HANDLE
+ACE_WIN32_Asynch_Accept_Result::listen_handle (void) const
+{
+ return this->listen_handle_;
+}
+
+ACE_HANDLE
+ACE_WIN32_Asynch_Accept_Result::accept_handle (void) const
+{
+ return this->accept_handle_;
+}
+
+ACE_WIN32_Asynch_Accept_Result::ACE_WIN32_Asynch_Accept_Result (ACE_Handler &handler,
+ ACE_HANDLE listen_handle,
+ ACE_HANDLE accept_handle,
+ ACE_Message_Block &message_block,
+ u_long bytes_to_read,
+ const void* act,
+ ACE_HANDLE event,
+ int priority)
+ : ACE_Asynch_Result_Impl (),
+ ACE_Asynch_Accept_Result_Impl (),
+ ACE_WIN32_Asynch_Result (handler, act, event, 0, 0, priority),
+ bytes_to_read_ (bytes_to_read),
+ message_block_ (message_block),
+ listen_handle_ (listen_handle),
+ accept_handle_ (accept_handle)
+{
+}
+
+void
+ACE_WIN32_Asynch_Accept_Result::complete (u_long bytes_transferred,
+ int success,
+ const void *completion_key,
+ u_long error)
+{
+ // Copy the data which was returned by GetQueuedCompletionStatus
+ this->bytes_transferred_ = bytes_transferred;
+ this->success_ = success;
+ this->completion_key_ = completion_key;
+ this->error_ = error;
+
+ // Appropriately move the pointers in the message block.
+ this->message_block_.wr_ptr (bytes_transferred);
+
+ // Create the interface result class.
+ ACE_Asynch_Accept::Result result (this);
+
+ // Call the application handler.
+ this->handler_.handle_accept (result);
+}
+
+ACE_WIN32_Asynch_Accept_Result::~ACE_WIN32_Asynch_Accept_Result (void)
+{
+}
+
+// Base class operations. These operations are here to kill some
+// warnings. These methods call the base class methods.
+
+u_long
+ACE_WIN32_Asynch_Accept_Result::bytes_transferred (void) const
+{
+ return ACE_WIN32_Asynch_Result::bytes_transferred ();
+}
+
+const void *
+ACE_WIN32_Asynch_Accept_Result::act (void) const
+{
+ return ACE_WIN32_Asynch_Result::act ();
+}
+
+int
+ACE_WIN32_Asynch_Accept_Result::success (void) const
+{
+ return ACE_WIN32_Asynch_Result::success ();
+}
+
+const void *
+ACE_WIN32_Asynch_Accept_Result::completion_key (void) const
+{
+ return ACE_WIN32_Asynch_Result::completion_key ();
+}
+
+u_long
+ACE_WIN32_Asynch_Accept_Result::error (void) const
+{
+ return ACE_WIN32_Asynch_Result::error ();
+}
+
+ACE_HANDLE
+ACE_WIN32_Asynch_Accept_Result::event (void) const
+{
+ return ACE_WIN32_Asynch_Result::event ();
+}
+
+u_long
+ACE_WIN32_Asynch_Accept_Result::offset (void) const
+{
+ return ACE_WIN32_Asynch_Result::offset ();
+}
+
+u_long
+ACE_WIN32_Asynch_Accept_Result::offset_high (void) const
+{
+ return ACE_WIN32_Asynch_Result::offset_high ();
+}
+
+int
+ACE_WIN32_Asynch_Accept_Result::priority (void) const
+{
+ return ACE_WIN32_Asynch_Result::priority ();
+}
+
+
+// ************************************************************
+
+ACE_WIN32_Asynch_Accept::ACE_WIN32_Asynch_Accept (ACE_WIN32_Proactor *win32_proactor)
+ : ACE_Asynch_Operation_Impl (),
+ ACE_Asynch_Accept_Impl (),
+ ACE_WIN32_Asynch_Operation (win32_proactor)
+{
+}
+
+int
+ACE_WIN32_Asynch_Accept::accept (ACE_Message_Block &message_block,
+ u_long bytes_to_read,
+ ACE_HANDLE accept_handle,
+ const void *act,
+ int priority)
+{
+#if (defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) || (defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0))
+ // 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 ();
+ size_t total_size = message_block.size ();
+ size_t available_space = total_size - space_in_use;
+ size_t space_needed = bytes_to_read + 2 * address_size;
+ if (available_space < space_needed)
+ ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("Buffer too small\n")), -1);
+
+ // WIN Specific.
+
+ int close_accept_handle = 0;
+ // If the <accept_handle> is invalid, we will create a new socket.
+ if (accept_handle == ACE_INVALID_HANDLE)
+ {
+ accept_handle = ACE_OS::socket (PF_INET,
+ SOCK_STREAM,
+ 0);
+ if (accept_handle == ACE_INVALID_HANDLE)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ASYS_TEXT ("%p\n"),
+ ASYS_TEXT ("ACE_OS::socket")), -1);
+ else
+ // Remember to close the socket down if failures occur.
+ close_accept_handle = 1;
+ }
+
+ // Common code for both WIN and POSIX.
+ ACE_WIN32_Asynch_Accept_Result *result = 0;
+ ACE_NEW_RETURN (result,
+ ACE_WIN32_Asynch_Accept_Result (*this->handler_,
+ this->handle_,
+ accept_handle,
+ message_block,
+ bytes_to_read,
+ act,
+ this->win32_proactor_->get_handle (),
+ priority),
+ -1);
+
+ u_long bytes_read;
+
+ // Initiate the accept.
+ int initiate_result = ::AcceptEx ((SOCKET) result->listen_handle (),
+ (SOCKET) result->accept_handle (),
+ result->message_block ().wr_ptr (),
+ result->bytes_to_read (),
+ address_size,
+ address_size,
+ &bytes_read,
+ result);
+ if (initiate_result == 1)
+ // Immediate success: the OVERLAPPED will still get queued.
+ return 1;
+
+ // If initiate failed, check for a bad error.
+ errno = ::GetLastError ();
+ switch (errno)
+ {
+ case ERROR_IO_PENDING:
+ // The IO will complete proactively: the OVERLAPPED will still
+ // get queued.
+ return 0;
+
+ default:
+ // Something else went wrong: the OVERLAPPED will not get
+ // queued.
+
+ if (close_accept_handle == 1)
+ // Close the newly created socket
+ ACE_OS::closesocket (accept_handle);
+
+ // Cleanup dynamically allocated Asynch_Result.
+ delete result;
+
+ ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ReadFile")), -1);
+ }
+#else /* ACE_HAS_WINNT4 .......|| ACE_HAS_AIO_CALLS */
+ ACE_NOTSUP_RETURN (-1);
+#endif /* (defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) || (defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)) || (defined (ACE_HAS_AIO_CALLS) */
+}
+
+ACE_WIN32_Asynch_Accept::~ACE_WIN32_Asynch_Accept (void)
+{
+}
+
+// Methods belong to ACE_WIN32_Asynch_Operation base class. These
+// methods are defined here to avoid VC++ warnings. They route the
+// call to the ACE_WIN32_Asynch_Operation base class.
+
+int
+ACE_WIN32_Asynch_Accept::open (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ const void *completion_key,
+ ACE_Proactor *proactor)
+{
+ return ACE_WIN32_Asynch_Operation::open (handler,
+ handle,
+ completion_key,
+ proactor);
+}
+
+int
+ACE_WIN32_Asynch_Accept::cancel (void)
+{
+ return ACE_WIN32_Asynch_Operation::cancel ();
+}
+
+ACE_Proactor *
+ACE_WIN32_Asynch_Accept::proactor (void) const
+{
+ return ACE_WIN32_Asynch_Operation::proactor ();
+}
+
+// *********************************************************************
+
+ACE_HANDLE
+ACE_WIN32_Asynch_Transmit_File_Result::socket (void) const
+{
+ return this->socket_;
+}
+
+ACE_HANDLE
+ACE_WIN32_Asynch_Transmit_File_Result::file (void) const
+{
+ return this->file_;
+}
+
+ACE_Asynch_Transmit_File::Header_And_Trailer *
+ACE_WIN32_Asynch_Transmit_File_Result::header_and_trailer (void) const
+{
+ return this->header_and_trailer_;
+}
+
+u_long
+ACE_WIN32_Asynch_Transmit_File_Result::bytes_to_write (void) const
+{
+ return this->bytes_to_write_;
+}
+
+u_long
+ACE_WIN32_Asynch_Transmit_File_Result::bytes_per_send (void) const
+{
+ return this->bytes_per_send_;
+}
+
+u_long
+ACE_WIN32_Asynch_Transmit_File_Result::flags (void) const
+{
+ return this->flags_;
+}
+
+ACE_WIN32_Asynch_Transmit_File_Result::ACE_WIN32_Asynch_Transmit_File_Result (ACE_Handler &handler,
+ ACE_HANDLE socket,
+ ACE_HANDLE file,
+ ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer,
+ u_long bytes_to_write,
+ u_long offset,
+ u_long offset_high,
+ u_long bytes_per_send,
+ u_long flags,
+ const void *act,
+ ACE_HANDLE event,
+ int priority)
+ : ACE_Asynch_Result_Impl (),
+ ACE_Asynch_Transmit_File_Result_Impl (),
+ ACE_WIN32_Asynch_Result (handler, act, event, offset, offset_high, priority),
+ socket_ (socket),
+ file_ (file),
+ header_and_trailer_ (header_and_trailer),
+ bytes_to_write_ (bytes_to_write),
+ bytes_per_send_ (bytes_per_send),
+ flags_ (flags)
+{
+}
+
+void
+ACE_WIN32_Asynch_Transmit_File_Result::complete (u_long bytes_transferred,
+ int success,
+ const void *completion_key,
+ u_long error)
+{
+ // Copy the data which was returned by GetQueuedCompletionStatus
+ this->bytes_transferred_ = bytes_transferred;
+ this->success_ = success;
+ this->completion_key_ = completion_key;
+ this->error_ = error;
+
+ // We will not do this because (a) the header and trailer blocks may
+ // be the same message_blocks and (b) in cases of failures we have
+ // no idea how much of what (header, data, trailer) was sent.
+ /*
+ if (this->success_ && this->header_and_trailer_ != 0)
+ {
+ ACE_Message_Block *header = this->header_and_trailer_->header ();
+ if (header != 0)
+ header->rd_ptr (this->header_and_trailer_->header_bytes ());
+
+ ACE_Message_Block *trailer = this->header_and_trailer_->trailer ();
+ if (trailer != 0)
+ trailer->rd_ptr (this->header_and_trailer_->trailer_bytes ());
+ }
+ */
+
+ // Create the interface result class.
+ ACE_Asynch_Transmit_File::Result result (this);
+
+ // Call the application handler.
+ this->handler_.handle_transmit_file (result);
+}
+
+ACE_WIN32_Asynch_Transmit_File_Result::~ACE_WIN32_Asynch_Transmit_File_Result (void)
+{
+}
+
+// Base class operations. These operations are here to kill some
+// warnings. These methods call the base class methods.
+
+u_long
+ACE_WIN32_Asynch_Transmit_File_Result::bytes_transferred (void) const
+{
+ return ACE_WIN32_Asynch_Result::bytes_transferred ();
+}
+
+const void *
+ACE_WIN32_Asynch_Transmit_File_Result::act (void) const
+{
+ return ACE_WIN32_Asynch_Result::act ();
+}
+
+int
+ACE_WIN32_Asynch_Transmit_File_Result::success (void) const
+{
+ return ACE_WIN32_Asynch_Result::success ();
+}
+
+const void *
+ACE_WIN32_Asynch_Transmit_File_Result::completion_key (void) const
+{
+ return ACE_WIN32_Asynch_Result::completion_key ();
+}
+
+u_long
+ACE_WIN32_Asynch_Transmit_File_Result::error (void) const
+{
+ return ACE_WIN32_Asynch_Result::error ();
+}
+
+ACE_HANDLE
+ACE_WIN32_Asynch_Transmit_File_Result::event (void) const
+{
+ return ACE_WIN32_Asynch_Result::event ();
+}
+
+u_long
+ACE_WIN32_Asynch_Transmit_File_Result::offset (void) const
+{
+ return ACE_WIN32_Asynch_Result::offset ();
+}
+
+u_long
+ACE_WIN32_Asynch_Transmit_File_Result::offset_high (void) const
+{
+ return ACE_WIN32_Asynch_Result::offset_high ();
+}
+
+int
+ACE_WIN32_Asynch_Transmit_File_Result::priority (void) const
+{
+ return ACE_WIN32_Asynch_Result::priority ();
+}
+
+
+// ************************************************************
+
+ACE_WIN32_Asynch_Transmit_File::ACE_WIN32_Asynch_Transmit_File (ACE_WIN32_Proactor *win32_proactor)
+ : ACE_Asynch_Operation_Impl (),
+ ACE_Asynch_Transmit_File_Impl (),
+ ACE_WIN32_Asynch_Operation (win32_proactor)
+{
+}
+
+int
+ACE_WIN32_Asynch_Transmit_File::transmit_file (ACE_HANDLE file,
+ ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer,
+ u_long bytes_to_write,
+ u_long offset,
+ u_long offset_high,
+ u_long bytes_per_send,
+ u_long flags,
+ const void *act,
+ int priority)
+{
+#if (defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) || (defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0))
+ ACE_WIN32_Asynch_Transmit_File_Result *result = 0;
+ ACE_NEW_RETURN (result,
+ ACE_WIN32_Asynch_Transmit_File_Result (*this->handler_,
+ this->handle_,
+ file,
+ header_and_trailer,
+ bytes_to_write,
+ offset,
+ offset_high,
+ bytes_per_send,
+ flags,
+ act,
+ this->win32_proactor_->get_handle (),
+ priority),
+ -1);
+
+ ACE_LPTRANSMIT_FILE_BUFFERS transmit_buffers = 0;
+ if (result->header_and_trailer () != 0)
+ transmit_buffers = result->header_and_trailer ()->transmit_buffers ();
+
+ // Initiate the transmit file
+ int initiate_result = ::TransmitFile ((SOCKET) result->socket (),
+ result->file (),
+ result->bytes_to_write (),
+ result->bytes_per_send (),
+ result,
+ transmit_buffers,
+ result->flags ());
+ if (initiate_result == 1)
+ // Immediate success: the OVERLAPPED will still get queued.
+ return 1;
+
+ // If initiate failed, check for a bad error.
+ errno = ::GetLastError ();
+ switch (errno)
+ {
+ case ERROR_IO_PENDING:
+ // The IO will complete proactively: the OVERLAPPED will still
+ // get queued.
+ return 0;
+
+ default:
+ // Something else went wrong: the OVERLAPPED will not get
+ // queued.
+
+ // Cleanup dynamically allocated Asynch_Result
+ delete result;
+
+ ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("TransmitFile")), -1);
+ }
+#else /* (defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) || (defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)) */
+ ACE_NOTSUP_RETURN (-1);
+#endif /* ACE_HAS_AIO_CALLS */
+}
+
+ACE_WIN32_Asynch_Transmit_File::~ACE_WIN32_Asynch_Transmit_File (void)
+{
+}
+
+// Methods belong to ACE_WIN32_Asynch_Operation base class. These
+// methods are defined here to avoid VC++ warnings. They route the
+// call to the ACE_WIN32_Asynch_Operation base class.
+
+int
+ACE_WIN32_Asynch_Transmit_File::open (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ const void *completion_key,
+ ACE_Proactor *proactor)
+{
+ return ACE_WIN32_Asynch_Operation::open (handler,
+ handle,
+ completion_key,
+ proactor);
+}
+
+int
+ACE_WIN32_Asynch_Transmit_File::cancel (void)
+{
+ return ACE_WIN32_Asynch_Operation::cancel ();
+}
+
+ACE_Proactor *
+ACE_WIN32_Asynch_Transmit_File::proactor (void) const
+{
+ return ACE_WIN32_Asynch_Operation::proactor ();
+}
+
+#endif /* ACE_WIN32 || ACE_HAS_WINCE */
+
+
diff --git a/ace/WIN32_Asynch_IO.h b/ace/WIN32_Asynch_IO.h
new file mode 100644
index 00000000000..c2552cc6f98
--- /dev/null
+++ b/ace/WIN32_Asynch_IO.h
@@ -0,0 +1,1154 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+//
+// ace
+//
+// = FILENAME
+//
+// WIN32_Asynch_IO.h
+//
+// = DESCRIPTION
+//
+// These classes 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.
+//
+// = AUTHOR
+//
+// Irfan Pyarali (irfan@cs.wustl.edu),
+// Tim Harrison (harrison@cs.wustl.edu) and
+// Alexander Babu Arulanthu <alex@cs.wustl.edu>
+//
+// ============================================================================
+
+#if !defined (ACE_WIN32_ASYNCH_IO_H)
+#define ACE_WIN32_ASYNCH_IO_H
+
+#include "ace/OS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE))
+
+#include "ace/Asynch_IO_Impl.h"
+
+// Forward declaration
+class ACE_WIN32_Proactor;
+
+class ACE_Export ACE_WIN32_Asynch_Result : public virtual ACE_Asynch_Result_Impl,
+ public OVERLAPPED
+{
+ // = TITLE
+ //
+ // An abstract class which adds information to the OVERLAPPED
+ // structure to make it more useful.
+ //
+ // = DESCRIPTION
+ //
+ // An abstract base class from which you can obtain some basic
+ // information like the number of bytes transferred, the ACT
+ // associated with the asynchronous operation, indication of
+ // success or failure, etc. Subclasses may want to store more
+ // information that is particular to the asynchronous operation
+ // it represents.
+
+ friend class ACE_WIN32_Asynch_Accept;
+ // Factory class has special permissions.
+
+ friend class ACE_WIN32_Proactor;
+ // Proactor class has special permission.
+
+public:
+ u_long bytes_transferred (void) const;
+ // Number of bytes transferred by the operation.
+
+ const void *act (void) const;
+ // ACT associated with the operation.
+
+ int success (void) const;
+ // Did the operation succeed?
+
+ const void *completion_key (void) const;
+ // This returns the ACT associated with the handle when it was
+ // registered with the I/O completion port. This ACT is not the
+ // same as the ACT associated with the asynchronous operation.
+
+ u_long error (void) const;
+ // Error value if the operation fail.
+
+ ACE_HANDLE event (void) const;
+ // Event associated with the OVERLAPPED structure.
+
+ u_long offset (void) const;
+ // This really make sense only when doing file I/O.
+
+ u_long offset_high (void) const;
+ // Offset_high associated with the OVERLAPPED structure.
+
+ int priority (void) const;
+ // The priority of the asynchronous operation. Currently, this is
+ // not supported on Win32.
+
+ virtual ~ACE_WIN32_Asynch_Result (void);
+ // Destructor.
+
+protected:
+ ACE_WIN32_Asynch_Result (ACE_Handler &handler,
+ const void* act,
+ ACE_HANDLE event,
+ u_long offset,
+ u_long offset_high,
+ int priority);
+ // Constructor.
+
+ ACE_Handler &handler_;
+ // Handler that will be called back.
+
+ const void *act_;
+ // ACT for this operation.
+
+ u_long bytes_transferred_;
+ // Bytes transferred by this operation.
+
+ int success_;
+ // Success indicator.
+
+ const void *completion_key_;
+ // ACT associated with handle.
+
+ u_long error_;
+ // Error if operation failed.
+};
+
+class ACE_Export ACE_WIN32_Asynch_Operation : public virtual ACE_Asynch_Operation_Impl
+{
+ // = TITLE
+ //
+ // This class abstracts out the common things needed for
+ // implementing Asynch_Operation for WIN32 platform.
+ //
+ // = DESCRIPTION
+ //
+public:
+ int open (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ const void *completion_key,
+ ACE_Proactor *proactor);
+ // Initializes the factory with information which will be used with
+ // each asynchronous call. If (<handle> == ACE_INVALID_HANDLE),
+ // <ACE_Handler::handle> will be called on the <handler> to get the
+ // correct handle.
+
+ int cancel (void);
+ // This cancels all pending accepts operations that were issued by
+ // the calling thread. The function does not cancel asynchronous
+ // operations issued by other threads.
+
+ // = Access methods.
+
+ ACE_Proactor* proactor (void) const;
+ // Return the underlying proactor.
+
+protected:
+ ACE_WIN32_Asynch_Operation (ACE_WIN32_Proactor *win32_proactor);
+ // Constructor.
+
+ virtual ~ACE_WIN32_Asynch_Operation (void);
+ // Destructor.
+
+ ACE_WIN32_Proactor *win32_proactor_;
+ // WIn32 Proactor.
+
+ ACE_Proactor *proactor_;
+ // Proactor that this asynch IO is registered with.
+
+ ACE_Handler *handler_;
+ // Handler that will receive the callback.
+
+ ACE_HANDLE handle_;
+ // I/O handle used for reading.
+};
+
+class ACE_Export ACE_WIN32_Asynch_Read_Stream_Result : public virtual ACE_Asynch_Read_Stream_Result_Impl,
+ public virtual ACE_WIN32_Asynch_Result
+{
+ // = TITLE
+ //
+ // This is class provides concrete implementation for
+ // ACE_Asynch_Read_Stream::Result class.
+ //
+ // = DESCRIPTION
+ //
+
+ friend class ACE_WIN32_Asynch_Read_Stream;
+ // Factory class will have special permissions.
+
+ friend class ACE_WIN32_Proactor;
+ // Proactor class has special permission.
+
+public:
+ u_long bytes_to_read (void) const;
+ // The number of bytes which were requested at the start of the
+ // asynchronous read.
+
+ ACE_Message_Block &message_block (void) const;
+ // Message block which contains the read data.
+
+ ACE_HANDLE handle (void) const;
+ // I/O handle used for reading.
+
+ // Base class operations. These operations are here to kill some
+ // warnings. These methods call the base class methods.
+
+ u_long bytes_transferred (void) const;
+ // Number of bytes transferred by the operation.
+
+ const void *act (void) const;
+ // ACT associated with the operation.
+
+ int success (void) const;
+ // Did the operation succeed?
+
+ const void *completion_key (void) const;
+ // This returns the ACT associated with the handle when it was
+ // registered with the I/O completion port. This ACT is not the
+ // same as the ACT associated with the asynchronous operation.
+
+ u_long error (void) const;
+ // Error value if the operation fail.
+
+ ACE_HANDLE event (void) const;
+ // Event associated with the OVERLAPPED structure.
+
+ u_long offset (void) const;
+ // This really make sense only when doing file I/O.
+
+ u_long offset_high (void) const;
+ // Offset_high associated with the OVERLAPPED structure.
+
+ int priority (void) const;
+ // The priority of the asynchronous operation. Currently, this is
+ // not supported on Win32.
+
+protected:
+ ACE_WIN32_Asynch_Read_Stream_Result (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ ACE_Message_Block &message_block,
+ u_long bytes_to_read,
+ const void* act,
+ ACE_HANDLE event,
+ int priority);
+ // Constructor is protected since creation is limited to
+ // ACE_Asynch_Read_Stream factory.
+
+ virtual void complete (u_long bytes_transferred,
+ int success,
+ const void *completion_key,
+ u_long error);
+ // Proactor will call this method when the read completes.
+
+ virtual ~ACE_WIN32_Asynch_Read_Stream_Result (void);
+ // Destructor.
+
+ u_long bytes_to_read_;
+ // Bytes requested when the asynchronous read was initiated.
+
+ ACE_Message_Block &message_block_;
+ // Message block for reading the data into.
+
+ ACE_HANDLE handle_;
+ // I/O handle used for reading.
+};
+
+class ACE_Export ACE_WIN32_Asynch_Read_Stream : public virtual ACE_Asynch_Read_Stream_Impl,
+ public ACE_WIN32_Asynch_Operation
+{
+ // = TITLE
+ //
+ // This class is a factory for starting off asynchronous reads
+ // on a stream.
+ //
+ // = DESCRIPTION
+ //
+ // Once <open> is called, multiple asynchronous <read>s can
+ // started using this class. An ACE_Asynch_Read_Stream::Result
+ // will be passed back to the <handler> when the asynchronous
+ // reads completes through the <ACE_Handler::handle_read_stream>
+ // callback.
+
+public:
+ ACE_WIN32_Asynch_Read_Stream (ACE_WIN32_Proactor *win32_proactor);
+ // Constructor.
+
+ int read (ACE_Message_Block &message_block,
+ u_long bytes_to_read,
+ const void *act,
+ int priority);
+ // This starts off an asynchronous read. Upto <bytes_to_read> will
+ // be read and stored in the <message_block>.
+
+ virtual ~ACE_WIN32_Asynch_Read_Stream (void);
+ // Destructor.
+
+ // Methods belong to ACE_WIN32_Asynch_Operation base class. These
+ // methods are defined here to avoid VC++ warnings. They route the
+ // call to the ACE_WIN32_Asynch_Operation base class.
+
+ int open (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ const void *completion_key,
+ ACE_Proactor *proactor);
+ // Initializes the factory with information which will be used with
+ // each asynchronous call. If (<handle> == ACE_INVALID_HANDLE),
+ // <ACE_Handler::handle> will be called on the <handler> to get the
+ // correct handle.
+
+ int cancel (void);
+ // This cancels all pending accepts operations that were issued by
+ // the calling thread. The function does not cancel asynchronous
+ // operations issued by other threads.
+
+ ACE_Proactor* proactor (void) const;
+ // Return the underlying proactor.
+
+protected:
+ int shared_read (ACE_WIN32_Asynch_Read_Stream_Result *result);
+ // This is the method which does the real work and is there so that
+ // the ACE_Asynch_Read_File class can use it too.
+};
+
+class ACE_Export ACE_WIN32_Asynch_Write_Stream_Result : public virtual ACE_Asynch_Write_Stream_Result_Impl,
+ public ACE_WIN32_Asynch_Result
+{
+ // = TITLE
+ //
+ // This is class provides concrete implementation for
+ // ACE_Asynch_Write_Stream::Result class.
+ //
+ // = DESCRIPTION
+ //
+
+ friend class ACE_WIN32_Asynch_Write_Stream;
+ // Factory class willl have special permissions.
+
+ friend class ACE_WIN32_Proactor;
+ // Proactor class has special permission.
+
+public:
+ u_long bytes_to_write (void) const;
+ // The number of bytes which were requested at the start of the
+ // asynchronous write.
+
+ ACE_Message_Block &message_block (void) const;
+ // Message block that contains the data to be written.
+
+ ACE_HANDLE handle (void) const;
+ // I/O handle used for writing.
+
+ // Base class operations. These operations are here to kill some
+ // warnings. These methods call the base class methods.
+
+ u_long bytes_transferred (void) const;
+ // Number of bytes transferred by the operation.
+
+ const void *act (void) const;
+ // ACT associated with the operation.
+
+ int success (void) const;
+ // Did the operation succeed?
+
+ const void *completion_key (void) const;
+ // This returns the ACT associated with the handle when it was
+ // registered with the I/O completion port. This ACT is not the
+ // same as the ACT associated with the asynchronous operation.
+
+ u_long error (void) const;
+ // Error value if the operation fail.
+
+ ACE_HANDLE event (void) const;
+ // Event associated with the OVERLAPPED structure.
+
+ u_long offset (void) const;
+ // This really make sense only when doing file I/O.
+
+ u_long offset_high (void) const;
+ // Offset_high associated with the OVERLAPPED structure.
+
+ int priority (void) const;
+ // The priority of the asynchronous operation. Currently, this is
+ // not supported on Win32.
+
+protected:
+ ACE_WIN32_Asynch_Write_Stream_Result (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ ACE_Message_Block &message_block,
+ u_long bytes_to_write,
+ const void* act,
+ ACE_HANDLE event,
+ int priority);
+ // Constructor is protected since creation is limited to
+ // ACE_Asynch_Write_Stream factory.
+
+ virtual void complete (u_long bytes_transferred,
+ int success,
+ const void *completion_key,
+ u_long error);
+ // ACE_Proactor will call this method when the write completes.
+
+ virtual ~ACE_WIN32_Asynch_Write_Stream_Result (void);
+ // Destructor.
+
+ u_long bytes_to_write_;
+ // The number of bytes which were requested at the start of the
+ // asynchronous write.
+
+ ACE_Message_Block &message_block_;
+ // Message block that contains the data to be written.
+
+ ACE_HANDLE handle_;
+ // I/O handle used for writing.
+};
+
+class ACE_Export ACE_WIN32_Asynch_Write_Stream : public virtual ACE_Asynch_Write_Stream_Impl,
+ public ACE_WIN32_Asynch_Operation
+{
+ // = TITLE
+ //
+ // This class is a factory for starting off asynchronous writes
+ // on a stream.
+ //
+ // = DESCRIPTION
+ //
+ // Once <open> is called, multiple asynchronous <writes>s can
+ // started using this class. A ACE_Asynch_Write_Stream::Result
+ // will be passed back to the <handler> when the asynchronous
+ // write completes through the
+ // <ACE_Handler::handle_write_stream> callback.
+
+public:
+ ACE_WIN32_Asynch_Write_Stream (ACE_WIN32_Proactor *win32_proactor);
+ // Constructor.
+
+ int write (ACE_Message_Block &message_block,
+ u_long bytes_to_write,
+ const void *act,
+ int priority);
+ // This starts off an asynchronous write. Upto <bytes_to_write>
+ // will be written from the <message_block>.
+
+ virtual ~ACE_WIN32_Asynch_Write_Stream (void);
+ // Destructor.
+
+ // Methods belong to ACE_WIN32_Asynch_Operation base class. These
+ // methods are defined here to avoid VC++ warnings. They route the
+ // call to the ACE_WIN32_Asynch_Operation base class.
+
+ int open (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ const void *completion_key,
+ ACE_Proactor *proactor);
+ // Initializes the factory with information which will be used with
+ // each asynchronous call. If (<handle> == ACE_INVALID_HANDLE),
+ // <ACE_Handler::handle> will be called on the <handler> to get the
+ // correct handle.
+
+ int cancel (void);
+ // This cancels all pending accepts operations that were issued by
+ // the calling thread. The function does not cancel asynchronous
+ // operations issued by other threads.
+
+ ACE_Proactor* proactor (void) const;
+ // Return the underlying proactor.
+
+protected:
+ int shared_write (ACE_WIN32_Asynch_Write_Stream_Result *result);
+ // This is the method which does the real work and is there so that
+ // the ACE_Asynch_Write_File class can use it too.
+};
+
+class ACE_Export ACE_WIN32_Asynch_Read_File_Result : public virtual ACE_Asynch_Read_File_Result_Impl,
+ public ACE_WIN32_Asynch_Read_Stream_Result
+{
+ // = TITLE
+ //
+ // This is class provides concrete implementation for
+ // ACE_Asynch_Read_File::Result class.
+ //
+ // = DESCRIPTION
+ //
+
+ friend class ACE_WIN32_Asynch_Read_File;
+ // Factory class will have special permissions.
+
+ friend class ACE_WIN32_Proactor;
+ // Proactor class has special permission.
+
+public:
+ // These methods belong to ACE_WIN32_Asynch_Result class base class.
+ // These operations are here to kill some warnings. These methods
+ // call the base class methods.
+
+ u_long bytes_transferred (void) const;
+ // Number of bytes transferred by the operation.
+
+ const void *act (void) const;
+ // ACT associated with the operation.
+
+ int success (void) const;
+ // Did the operation succeed?
+
+ const void *completion_key (void) const;
+ // This returns the ACT associated with the handle when it was
+ // registered with the I/O completion port. This ACT is not the
+ // same as the ACT associated with the asynchronous operation.
+
+ u_long error (void) const;
+ // Error value if the operation fail.
+
+ ACE_HANDLE event (void) const;
+ // Event associated with the OVERLAPPED structure.
+
+ u_long offset (void) const;
+ // This really make sense only when doing file I/O.
+
+ u_long offset_high (void) const;
+ // Offset_high associated with the OVERLAPPED structure.
+
+ int priority (void) const;
+ // The priority of the asynchronous operation. Currently, this is
+ // not supported on Win32.
+
+ // The following methods belong to
+ // ACE_WIN32_Asynch_Read_Stream_Result. They are here to avoid VC++
+ // warnings. These methods route their call to the
+ // ACE_WIN32_Asynch_Read_Stream_Result base class.
+
+ u_long bytes_to_read (void) const;
+ // The number of bytes which were requested at the start of the
+ // asynchronous read.
+
+ ACE_Message_Block &message_block (void) const;
+ // Message block which contains the read data.
+
+ ACE_HANDLE handle (void) const;
+ // I/O handle used for reading.
+
+protected:
+ ACE_WIN32_Asynch_Read_File_Result (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ ACE_Message_Block &message_block,
+ u_long bytes_to_read,
+ const void* act,
+ u_long offset,
+ u_long offset_high,
+ ACE_HANDLE event,
+ int priority);
+ // Constructor is protected since creation is limited to
+ // ACE_Asynch_Read_File factory.
+
+ virtual void complete (u_long bytes_transferred,
+ int success,
+ const void *completion_key,
+ u_long error);
+ // ACE_Proactor will call this method when the read completes.
+
+ virtual ~ACE_WIN32_Asynch_Read_File_Result (void);
+ // Destructor.
+};
+
+class ACE_Export ACE_WIN32_Asynch_Read_File : public virtual ACE_Asynch_Read_File_Impl,
+ public ACE_WIN32_Asynch_Read_Stream
+{
+ // = TITLE
+ //
+ // This class is a factory for starting off asynchronous reads
+ // on a file.
+ //
+ // = DESCRIPTION
+ //
+ // Once <open> is called, multiple asynchronous <read>s can
+ // started using this class. A ACE_Asynch_Read_File::Result
+ // will be passed back to the <handler> when the asynchronous
+ // reads completes through the <ACE_Handler::handle_read_file>
+ // callback.
+ //
+ // This class differs slightly from ACE_Asynch_Read_Stream as it
+ // allows the user to specify an offset for the read.
+
+public:
+ ACE_WIN32_Asynch_Read_File (ACE_WIN32_Proactor *win32_proactor);
+ // Constructor.
+
+ int read (ACE_Message_Block &message_block,
+ u_long bytes_to_read,
+ u_long offset,
+ u_long offset_high,
+ const void *act,
+ int priority);
+ // This starts off an asynchronous read. Upto <bytes_to_read> will
+ // be read and stored in the <message_block>. The read will start
+ // at <offset> from the beginning of the file.
+
+ virtual ~ACE_WIN32_Asynch_Read_File (void);
+ // Destructor.
+
+ // Methods belong to ACE_WIN32_Asynch_Operation base class. These
+ // methods are defined here to avoid VC++ warnings. They route the
+ // call to the ACE_WIN32_Asynch_Operation base class.
+
+ int open (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ const void *completion_key,
+ ACE_Proactor *proactor);
+ // Initializes the factory with information which will be used with
+ // each asynchronous call. If (<handle> == ACE_INVALID_HANDLE),
+ // <ACE_Handler::handle> will be called on the <handler> to get the
+ // correct handle.
+
+ int cancel (void);
+ // This cancels all pending accepts operations that were issued by
+ // the calling thread. The function does not cancel asynchronous
+ // operations issued by other threads.
+
+ ACE_Proactor* proactor (void) const;
+ // Return the underlying proactor.
+
+private:
+ int read (ACE_Message_Block &message_block,
+ u_long bytes_to_read,
+ const void *act,
+ int priority);
+ // This method belongs to ACE_WIN32_Asynch_Read_Stream. It is here
+ // to avoid the compiler warnings. We forward this call to the
+ // ACE_WIN32_Asynch_Read_Stream class.
+};
+
+class ACE_Export ACE_WIN32_Asynch_Write_File_Result : public virtual ACE_Asynch_Write_File_Result_Impl,
+ public ACE_WIN32_Asynch_Write_Stream_Result
+{
+ // = TITLE
+ //
+ // This class provides implementation for
+ // ACE_Asynch_Write_File_Result for WIN32 platforms.
+ //
+ // = DESCRIPTION
+ //
+ // This class has all the information necessary for the
+ // <handler> to uniquiely identify the completion of the
+ // asynchronous write.
+ //
+ // This class differs slightly from
+ // ACE_Asynch_Write_Stream::Result as it calls back
+ // <ACE_Handler::handle_write_file> on the <handler> instead
+ // of <ACE_Handler::handle_write_stream>. No additional state
+ // is required by this class as ACE_Asynch_Result can store
+ // the <offset>.
+
+ friend class ACE_WIN32_Asynch_Write_File;
+ // Factory class will have special permission.
+
+ friend class ACE_WIN32_Proactor;
+ // Proactor class has special permission.
+
+public:
+ // Base class operations. These operations are here to kill some
+ // warnings. These methods call the base class methods.
+
+ u_long bytes_transferred (void) const;
+ // Number of bytes transferred by the operation.
+
+ const void *act (void) const;
+ // ACT associated with the operation.
+
+ int success (void) const;
+ // Did the operation succeed?
+
+ const void *completion_key (void) const;
+ // This returns the ACT associated with the handle when it was
+ // registered with the I/O completion port. This ACT is not the
+ // same as the ACT associated with the asynchronous operation.
+
+ u_long error (void) const;
+ // Error value if the operation fail.
+
+ ACE_HANDLE event (void) const;
+ // Event associated with the OVERLAPPED structure.
+
+ u_long offset (void) const;
+ // This really make sense only when doing file I/O.
+
+ u_long offset_high (void) const;
+ // Offset_high associated with the OVERLAPPED structure.
+
+ int priority (void) const;
+ // The priority of the asynchronous operation. Currently, this is
+ // not supported on Win32.
+
+ // The following methods belong to
+ // ACE_WIN32_Asynch_Read_Stream_Result. They are here to avoid VC++
+ // warnings. These methods route their call to the
+ // ACE_WIN32_Asynch_Read_Stream_Result base class.
+
+ u_long bytes_to_write (void) const;
+ // The number of bytes which were requested at the start of the
+ // asynchronous write.
+
+ ACE_Message_Block &message_block (void) const;
+ // Message block that contains the data to be written.
+
+ ACE_HANDLE handle (void) const;
+ // I/O handle used for writing.
+
+protected:
+ ACE_WIN32_Asynch_Write_File_Result (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ ACE_Message_Block &message_block,
+ u_long bytes_to_write,
+ const void* act,
+ u_long offset,
+ u_long offset_high,
+ ACE_HANDLE event,
+ int priority);
+ // Constructor is protected since creation is limited to
+ // ACE_Asynch_Write_File factory.
+
+ virtual void complete (u_long bytes_transferred,
+ int success,
+ const void *completion_key,
+ u_long error);
+ // ACE_Proactor will call this method when the write completes.
+
+ virtual ~ACE_WIN32_Asynch_Write_File_Result (void);
+ // Destructor.
+};
+
+class ACE_Export ACE_WIN32_Asynch_Write_File : public virtual ACE_Asynch_Write_File_Impl,
+ public ACE_WIN32_Asynch_Write_Stream
+{
+ // = TITLE
+ //
+ // This class is a factory for starting off asynchronous writes
+ // on a file.
+ //
+ // = DESCRIPTION
+ //
+ // Once <open> is called, multiple asynchronous <write>s can be
+ // started using this class. A ACE_Asynch_Write_File::Result
+ // will be passed back to the <handler> when the asynchronous
+ // writes completes through the <ACE_Handler::handle_write_file>
+ // callback.
+
+public:
+ ACE_WIN32_Asynch_Write_File (ACE_WIN32_Proactor *win32_proactor);
+ // Constructor.
+
+ int write (ACE_Message_Block &message_block,
+ u_long bytes_to_write,
+ u_long offset,
+ u_long offset_high,
+ const void *act,
+ int priority);
+ // This starts off an asynchronous write. Upto <bytes_to_write>
+ // will be write and stored in the <message_block>. The write will
+ // start at <offset> from the beginning of the file.
+
+ virtual ~ACE_WIN32_Asynch_Write_File (void);
+ // Destrcutor.
+
+ // Methods belong to ACE_WIN32_Asynch_Operation base class. These
+ // methods are defined here to avoid VC++ warnings. They route the
+ // call to the ACE_WIN32_Asynch_Operation base class.
+
+ int open (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ const void *completion_key,
+ ACE_Proactor *proactor);
+ // Initializes the factory with information which will be used with
+ // each asynchronous call. If (<handle> == ACE_INVALID_HANDLE),
+ // <ACE_Handler::handle> will be called on the <handler> to get the
+ // correct handle.
+
+ int cancel (void);
+ // This cancels all pending accepts operations that were issued by
+ // the calling thread. The function does not cancel asynchronous
+ // operations issued by other threads.
+
+ ACE_Proactor* proactor (void) const;
+ // Return the underlying proactor.
+
+private:
+ int write (ACE_Message_Block &message_block,
+ u_long bytes_to_write,
+ const void *act,
+ int priority);
+ // This method belongs to ACE_WIN32_Asynch_Write_Stream. It is here
+ // to avoid compiler warnings. This method is forwarded to the
+ // ACE_WIN32_Asynch_Write_Stream class.
+};
+
+class ACE_Export ACE_WIN32_Asynch_Accept_Result : public virtual ACE_Asynch_Accept_Result_Impl,
+ public ACE_WIN32_Asynch_Result
+{
+ // = TITLE
+ //
+ // This class implements ACE_Asynch_Accept::Result for WIN32
+ // platform.
+ //
+ // = DESCRIPTION
+ //
+ // This class has all the information necessary for the
+ // <handler> to uniquiely identify the completion of the
+ // asynchronous accept.
+
+ friend class ACE_WIN32_Asynch_Accept;
+ // Factory will have special permission.
+
+ friend class ACE_WIN32_Proactor;
+ // Proactor class has special permission.
+
+public:
+ u_long bytes_to_read (void) const;
+ // The number of bytes which were requested at the start of the
+ // asynchronous accept.
+
+ ACE_Message_Block &message_block (void) const;
+ // Message block which contains the read data.
+
+ ACE_HANDLE listen_handle (void) const;
+ // I/O handle used for accepting new connections.
+
+ ACE_HANDLE accept_handle (void) const;
+ // I/O handle for the new connection.
+
+ // Base class operations. These operations are here to kill some
+ // warnings. These methods call the base class methods.
+
+ u_long bytes_transferred (void) const;
+ // Number of bytes transferred by the operation.
+
+ const void *act (void) const;
+ // ACT associated with the operation.
+
+ int success (void) const;
+ // Did the operation succeed?
+
+ const void *completion_key (void) const;
+ // This returns the ACT associated with the handle when it was
+ // registered with the I/O completion port. This ACT is not the
+ // same as the ACT associated with the asynchronous operation.
+
+ u_long error (void) const;
+ // Error value if the operation fail.
+
+ ACE_HANDLE event (void) const;
+ // Event associated with the OVERLAPPED structure.
+
+ u_long offset (void) const;
+ // This really make sense only when doing file I/O.
+
+ u_long offset_high (void) const;
+ // Offset_high associated with the OVERLAPPED structure.
+
+ int priority (void) const;
+ // The priority of the asynchronous operation. Currently, this is
+ // not supported on Win32.
+
+protected:
+ ACE_WIN32_Asynch_Accept_Result (ACE_Handler &handler,
+ ACE_HANDLE listen_handle,
+ ACE_HANDLE accept_handle,
+ ACE_Message_Block &message_block,
+ u_long bytes_to_read,
+ const void* act,
+ ACE_HANDLE event,
+ int priority);
+ // Constructor is protected since creation is limited to
+ // ACE_Asynch_Accept factory.
+
+ virtual void complete (u_long bytes_transferred,
+ int success,
+ const void *completion_key,
+ u_long error);
+ // ACE_Proactor will call this method when the accept completes.
+
+ virtual ~ACE_WIN32_Asynch_Accept_Result (void);
+ // Destructor.
+
+ u_long bytes_to_read_;
+ // Bytes requested when the asynchronous read was initiated.
+
+ ACE_Message_Block &message_block_;
+ // Message block for reading the data into.
+
+ ACE_HANDLE listen_handle_;
+ // I/O handle used for accepting new connections.
+
+ ACE_HANDLE accept_handle_;
+ // I/O handle for the new connection.
+};
+
+class ACE_Export ACE_WIN32_Asynch_Accept : public virtual ACE_Asynch_Accept_Impl,
+ public ACE_WIN32_Asynch_Operation
+{
+ // = TITLE
+ //
+ // This class is a factory for starting off asynchronous accepts
+ // on a listen handle.
+ //
+ // = DESCRIPTION
+ //
+ // Once <open> is called, multiple asynchronous <accept>s can
+ // started using this class. A ACE_Asynch_Accept::Result will
+ // be passed back to the <handler> when the asynchronous accept
+ // completes through the <ACE_Handler::handle_accept>
+ // callback.
+
+public:
+ ACE_WIN32_Asynch_Accept (ACE_WIN32_Proactor *win32_proactor);
+ // Constructor.
+
+ int accept (ACE_Message_Block &message_block,
+ u_long bytes_to_read,
+ ACE_HANDLE accept_handle,
+ const void *act,
+ int priority);
+ // This starts off an asynchronous accept. The asynchronous accept
+ // call also allows any initial data to be returned to the
+ // <handler>. Upto <bytes_to_read> will be read and stored in the
+ // <message_block>. The <accept_handle> will be used for the
+ // <accept> call. If (<accept_handle> == INVALID_HANDLE), a new
+ // handle will be created.
+ //
+ // <message_block> must be specified. This is because the address of
+ // the new connection is placed at the end of this buffer.
+
+ ~ACE_WIN32_Asynch_Accept (void);
+ // Destructor.
+
+ // Methods belong to ACE_WIN32_Asynch_Operation base class. These
+ // methods are defined here to avoid VC++ warnings. They route the
+ // call to the ACE_WIN32_Asynch_Operation base class.
+
+ int open (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ const void *completion_key,
+ ACE_Proactor *proactor);
+ // Initializes the factory with information which will be used with
+ // each asynchronous call. If (<handle> == ACE_INVALID_HANDLE),
+ // <ACE_Handler::handle> will be called on the <handler> to get the
+ // correct handle.
+
+ int cancel (void);
+ // This cancels all pending accepts operations that were issued by
+ // the calling thread. The function does not cancel asynchronous
+ // operations issued by other threads.
+
+ ACE_Proactor* proactor (void) const;
+ // Return the underlying proactor.
+};
+
+class ACE_Export ACE_WIN32_Asynch_Transmit_File_Result : public virtual ACE_Asynch_Transmit_File_Result_Impl,
+ public ACE_WIN32_Asynch_Result
+{
+ // = TITLE
+ //
+ // This class implements ACE_Asynch_Transmit_File::Result for
+ // WIN32 platforms.
+ //
+ // = DESCRIPTION
+ //
+ // This class has all the information necessary for the
+ // <handler> to uniquiely identify the completion of the
+ // asynchronous transmit file.
+
+ friend class ACE_WIN32_Asynch_Transmit_File;
+ // Factory class will have special permission.
+
+ friend class ACE_WIN32_Proactor;
+ // Proactor class has special permission.
+
+public:
+ ACE_HANDLE socket (void) const;
+ // Socket used for transmitting the file.
+
+ ACE_HANDLE file (void) const;
+ // File from which the data is read.
+
+ ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer (void) const;
+ // Header and trailer data associated with this transmit file.
+
+ u_long bytes_to_write (void) const;
+ // The number of bytes which were requested at the start of the
+ // asynchronous transmit file.
+
+ u_long bytes_per_send (void) const;
+ // Number of bytes per send requested at the start of the transmit
+ // file.
+
+ u_long flags (void) const;
+ // Flags which were passed into transmit file.
+
+ // Base class operations. These operations are here to kill some
+ // warnings. These methods call the base class methods.
+
+ u_long bytes_transferred (void) const;
+ // Number of bytes transferred by the operation.
+
+ const void *act (void) const;
+ // ACT associated with the operation.
+
+ int success (void) const;
+ // Did the operation succeed?
+
+ const void *completion_key (void) const;
+ // This returns the ACT associated with the handle when it was
+ // registered with the I/O completion port. This ACT is not the
+ // same as the ACT associated with the asynchronous operation.
+
+ u_long error (void) const;
+ // Error value if the operation fail.
+
+ ACE_HANDLE event (void) const;
+ // Event associated with the OVERLAPPED structure.
+
+ u_long offset (void) const;
+ // This really make sense only when doing file I/O.
+
+ u_long offset_high (void) const;
+ // Offset_high associated with the OVERLAPPED structure.
+
+ int priority (void) const;
+ // The priority of the asynchronous operation. Currently, this is
+ // not supported on Win32.
+
+protected:
+ ACE_WIN32_Asynch_Transmit_File_Result (ACE_Handler &handler,
+ ACE_HANDLE socket,
+ ACE_HANDLE file,
+ ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer,
+ u_long bytes_to_write,
+ u_long offset,
+ u_long offset_high,
+ u_long bytes_per_send,
+ u_long flags,
+ const void *act,
+ ACE_HANDLE event,
+ int priority);
+ // Constructor is protected since creation is limited to
+ // ACE_Asynch_Transmit_File factory.
+
+ virtual void complete (u_long bytes_transferred,
+ int success,
+ const void *completion_key,
+ u_long error);
+ // Proactor will call this method when the write completes.
+
+ virtual ~ACE_WIN32_Asynch_Transmit_File_Result (void);
+ // Destructor.
+
+ ACE_HANDLE socket_;
+ // Network I/O handle.
+
+ ACE_HANDLE file_;
+ // File I/O handle.
+
+ ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer_;
+ // Header and trailer data associated with this transmit file.
+
+ u_long bytes_to_write_;
+ // The number of bytes which were requested at the start of the
+ // asynchronous transmit file.
+
+ u_long bytes_per_send_;
+ // Number of bytes per send requested at the start of the transmit
+ // file.
+
+ u_long flags_;
+ // Flags which were passed into transmit file.
+};
+
+class ACE_Export ACE_WIN32_Asynch_Transmit_File : public virtual ACE_Asynch_Transmit_File_Impl,
+ public ACE_WIN32_Asynch_Operation
+{
+ // = TITLE
+ //
+ // This class is a factory for starting off asynchronous
+ // transmit files on a stream.
+ //
+ // = DESCRIPTION
+ //
+ // Once <open> is called, multiple asynchronous <transmit_file>s
+ // can started using this class. A
+ // ACE_Asynch_Transmit_File::Result will be passed back to the
+ // <handler> when the asynchronous transmit file completes
+ // through the <ACE_Handler::handle_transmit_file> callback.
+ //
+ // The transmit_file function transmits file data over a
+ // connected network connection. The function uses the operating
+ // system's cache manager to retrieve the file data. This
+ // function provides high-performance file data transfer over
+ // network connections. This function would be of great use in
+ // a Web Server, Image Server, etc.
+
+public:
+ ACE_WIN32_Asynch_Transmit_File (ACE_WIN32_Proactor *win32_proactor);
+ // Constructor.
+
+ int transmit_file (ACE_HANDLE file,
+ ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer,
+ u_long bytes_to_write,
+ u_long offset,
+ u_long offset_high,
+ u_long bytes_per_send,
+ u_long flags,
+ const void *act,
+ int priority);
+ // This starts off an asynchronous transmit file. The <file> is a
+ // handle to an open file. <header_and_trailer> is a pointer to a
+ // data structure that contains pointers to data to send before and
+ // after the file data is sent. Set this parameter to 0 if you only
+ // want to transmit the file data. Upto <bytes_to_write> will be
+ // written to the <socket>. If you want to send the entire file,
+ // let <bytes_to_write> = 0. <bytes_per_send> is the size of each
+ // block of data sent per send operation. Please read the Win32
+ // documentation on what the flags should be.
+
+ ~ACE_WIN32_Asynch_Transmit_File (void);
+ // Destructor.
+
+ // Methods belong to ACE_WIN32_Asynch_Operation base class. These
+ // methods are defined here to avoid VC++ warnings. They route the
+ // call to the ACE_WIN32_Asynch_Operation base class.
+
+ int open (ACE_Handler &handler,
+ ACE_HANDLE handle,
+ const void *completion_key,
+ ACE_Proactor *proactor);
+ // Initializes the factory with information which will be used with
+ // each asynchronous call. If (<handle> == ACE_INVALID_HANDLE),
+ // <ACE_Handler::handle> will be called on the <handler> to get the
+ // correct handle.
+
+ int cancel (void);
+ // This cancels all pending accepts operations that were issued by
+ // the calling thread. The function does not cancel asynchronous
+ // operations issued by other threads.
+
+ ACE_Proactor* proactor (void) const;
+ // Return the underlying proactor.
+};
+
+#if defined (__ACE_INLINE__)
+#include "ace/WIN32_Asynch_IO.i"
+#endif /* __ACE_INLINE__ */
+
+#endif /* ACE_WIN32 && !ACE_HAS_WINCE */
+#endif /* ACE_WIN32_ASYNCH_IO_H */
diff --git a/ace/WIN32_Asynch_IO.i b/ace/WIN32_Asynch_IO.i
new file mode 100644
index 00000000000..6318deb79a0
--- /dev/null
+++ b/ace/WIN32_Asynch_IO.i
@@ -0,0 +1,2 @@
+/* -*- C++ -*- */
+// $Id$
diff --git a/ace/ace_dll.dsp b/ace/ace_dll.dsp
index fcb8d7de007..a70bc448904 100644
--- a/ace/ace_dll.dsp
+++ b/ace/ace_dll.dsp
@@ -14,22 +14,29 @@ CFG=ACE dynamic library - Win32 Debug
!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 "ace_dll.mak" CFG="ACE dynamic library - Win32 Alpha Unicode Debug"
+!MESSAGE NMAKE /f "ace_dll.mak" CFG="ACE dynamic library - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
-!MESSAGE "ACE dynamic library - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ACE dynamic library - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ACE dynamic library - Win32 Unicode Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ACE dynamic library - Win32 Unicode Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ACE dynamic library - Win32 Alpha Debug" (based on "Win32 (ALPHA) Dynamic-Link Library")
-!MESSAGE "ACE dynamic library - Win32 Alpha Release" (based on "Win32 (ALPHA) Dynamic-Link Library")
-!MESSAGE "ACE dynamic library - Win32 Alpha Unicode Debug" (based on "Win32 (ALPHA) Dynamic-Link Library")
-!MESSAGE "ACE dynamic library - Win32 Alpha Unicode Release" (based on "Win32 (ALPHA) Dynamic-Link Library")
+!MESSAGE "ACE dynamic library - Win32 Debug" (based on\
+ "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "ACE dynamic library - Win32 Release" (based on\
+ "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "ACE dynamic library - Win32 Unicode Debug" (based on\
+ "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "ACE dynamic library - Win32 Unicode Release" (based on\
+ "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "ACE dynamic library - Win32 Alpha Debug" (based on\
+ "Win32 (ALPHA) Dynamic-Link Library")
+!MESSAGE "ACE dynamic library - Win32 Alpha Release" (based on\
+ "Win32 (ALPHA) Dynamic-Link Library")
+!MESSAGE "ACE dynamic library - Win32 Alpha Unicode Debug" (based on\
+ "Win32 (ALPHA) Dynamic-Link Library")
+!MESSAGE "ACE dynamic library - Win32 Alpha Unicode Release" (based on\
+ "Win32 (ALPHA) Dynamic-Link Library")
!MESSAGE
# Begin Project
-# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
@@ -171,14 +178,14 @@ LINK32=link.exe
# PROP Intermediate_Dir "DLL\Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /o /win32 "NUL" "NUL"
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /o /win32 "NUL" "NUL"
CPP=cl.exe
# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /FD /MTd /c
# SUBTRACT BASE CPP /YX /Yc /Yu
# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /FD /MDd /c
# SUBTRACT CPP /YX /Yc /Yu
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
RSC=rc.exe
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
@@ -205,14 +212,14 @@ LINK32=link.exe
# PROP Intermediate_Dir "DLL\Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /o /win32 "NUL" "NUL"
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /o /win32 "NUL" "NUL"
CPP=cl.exe
# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /Ob2 /I "..\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /MD /Gt0 /W3 /GX /O2 /Ob2 /I "..\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /FD /c
# SUBTRACT CPP /YX
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
RSC=rc.exe
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@@ -239,14 +246,14 @@ LINK32=link.exe
# PROP Intermediate_Dir "DLL\Unicode_Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /o /win32 "NUL" "NUL"
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /o /win32 "NUL" "NUL"
CPP=cl.exe
# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /D "UNICODE" /FD /MTd /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /D "UNICODE" /FD /MTd /c
# SUBTRACT CPP /YX
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
RSC=rc.exe
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
@@ -273,14 +280,14 @@ LINK32=link.exe
# PROP Intermediate_Dir "DLL\Unicode_Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /o /win32 "NUL" "NUL"
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /o /win32 "NUL" "NUL"
CPP=cl.exe
# ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /Ob2 /I "..\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /D "UNICODE" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /MT /Gt0 /W3 /GX /O2 /Ob2 /I "..\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D ACE_HAS_DLL=1 /D "UNICODE" /FD /c
# SUBTRACT CPP /YX
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
RSC=rc.exe
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@@ -27364,5 +27371,51 @@ SOURCE=.\Readme
SOURCE=..\Version
# End Source File
# End Group
+# Begin Source File
+
+SOURCE=.\Asynch_IO_Impl.cpp
+
+!IF "$(CFG)" == "ACE dynamic library - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Unicode Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Unicode Release"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\WIN32_Asynch_IO.cpp
+
+!IF "$(CFG)" == "ACE dynamic library - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Unicode Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE dynamic library - Win32 Alpha Unicode Release"
+
+!ENDIF
+
+# End Source File
# End Target
# End Project
diff --git a/ace/ace_lib.dsp b/ace/ace_lib.dsp
index a5d4c0667b9..bf5e6031382 100644
--- a/ace/ace_lib.dsp
+++ b/ace/ace_lib.dsp
@@ -14,22 +14,30 @@ CFG=ACE static library - Win32 Alpha Unicode Debug
!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 "ace_lib.mak" CFG="ACE static library - Win32 Alpha Unicode Debug"
+!MESSAGE NMAKE /f "ace_lib.mak"\
+ CFG="ACE static library - Win32 Alpha Unicode Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
-!MESSAGE "ACE static library - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE "ACE static library - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "ACE static library - Win32 Unicode Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE "ACE static library - Win32 Unicode Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "ACE static library - Win32 Alpha Debug" (based on "Win32 (ALPHA) Static Library")
-!MESSAGE "ACE static library - Win32 Alpha Release" (based on "Win32 (ALPHA) Static Library")
-!MESSAGE "ACE static library - Win32 Alpha Unicode Debug" (based on "Win32 (ALPHA) Static Library")
-!MESSAGE "ACE static library - Win32 Alpha Unicode Release" (based on "Win32 (ALPHA) Static Library")
+!MESSAGE "ACE static library - Win32 Debug" (based on\
+ "Win32 (x86) Static Library")
+!MESSAGE "ACE static library - Win32 Release" (based on\
+ "Win32 (x86) Static Library")
+!MESSAGE "ACE static library - Win32 Unicode Debug" (based on\
+ "Win32 (x86) Static Library")
+!MESSAGE "ACE static library - Win32 Unicode Release" (based on\
+ "Win32 (x86) Static Library")
+!MESSAGE "ACE static library - Win32 Alpha Debug" (based on\
+ "Win32 (ALPHA) Static Library")
+!MESSAGE "ACE static library - Win32 Alpha Release" (based on\
+ "Win32 (ALPHA) Static Library")
+!MESSAGE "ACE static library - Win32 Alpha Unicode Debug" (based on\
+ "Win32 (ALPHA) Static Library")
+!MESSAGE "ACE static library - Win32 Alpha Unicode Release" (based on\
+ "Win32 (ALPHA) Static Library")
!MESSAGE
# Begin Project
-# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
@@ -45,13 +53,13 @@ CFG=ACE static library - Win32 Alpha Unicode Debug
# PROP Output_Dir ""
# PROP Intermediate_Dir ".\LIB\Debug"
# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
CPP=cl.exe
# ADD BASE CPP /nologo /G5 /MTd /W3 /Gm /GX /Zi /Od /Gy /I "..\STL" /I "..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /D __ACE_INLINE__=0 /YX /FD /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /Gy /I "..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /FD /c
# SUBTRACT CPP /YX
-RSC=rc.exe
-# ADD BASE RSC /l 0x409
-# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o"ace.bsc"
# ADD BSC32 /nologo /o".\ace.bsc"
@@ -71,13 +79,13 @@ LIB32=link.exe -lib
# PROP Output_Dir ""
# PROP Intermediate_Dir ".\LIB\Release"
# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
CPP=cl.exe
# ADD BASE CPP /nologo /G5 /MT /W3 /GX /O1 /I "..\STL" /I "..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /D __ACE_INLINE__=0 /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O1 /I "..\\" /D ACE_HAS_DLL=0 /D __ACE_INLINE__=0 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
-RSC=rc.exe
-# ADD BASE RSC /l 0x409
-# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o"ace.bsc"
# ADD BSC32 /nologo /o".\ace.bsc"
@@ -97,13 +105,13 @@ LIB32=link.exe -lib
# PROP Output_Dir ""
# PROP Intermediate_Dir ".\LIB\Unicode_Debug"
# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
CPP=cl.exe
# ADD BASE CPP /nologo /G5 /MTd /W3 /Gm /GX /Zi /Od /Gy /I "..\STL" /I "..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /D __ACE_INLINE__=0 /YX /FD /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /Gy /I "..\\" /D ACE_HAS_DLL=0 /D __ACE_INLINE__=0 /D "_DEBUG" /D "UNICODE" /D "WIN32" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
-RSC=rc.exe
-# ADD BASE RSC /l 0x409
-# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o"ace.bsc"
# ADD BSC32 /nologo /o".\ace.bsc"
@@ -123,13 +131,13 @@ LIB32=link.exe -lib
# PROP Output_Dir ""
# PROP Intermediate_Dir ".\LIB\Unicode_Release"
# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
CPP=cl.exe
# ADD BASE CPP /nologo /G5 /MT /W3 /GX /O1 /I "..\STL" /I "..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /D __ACE_INLINE__=0 /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O1 /I "..\\" /D ACE_HAS_DLL=0 /D __ACE_INLINE__=0 /D "NDEBUG" /D "UNICODE" /D "WIN32" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
-RSC=rc.exe
-# ADD BASE RSC /l 0x409
-# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o"ace.bsc"
# ADD BSC32 /nologo /o".\ace.bsc"
@@ -150,9 +158,9 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "Lib\Debug"
# PROP Target_Dir ""
CPP=cl.exe
-# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D " WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
+# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /D "_DEBUG" /D "_WINDOWS" /FD /I "..\\ /D " WIN32" /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D " WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /MTd /c
+# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /D "_DEBUG" /D "_WINDOWS" /FD /I /MTd "..\\ /D " WIN32" /c
# SUBTRACT CPP /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o".\ace.bsc"
@@ -174,9 +182,9 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "Lib\Release"
# PROP Target_Dir ""
CPP=cl.exe
-# ADD BASE CPP /nologo /Gt0 /W3 /GX /O1 /I "..\\ /D " WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
+# ADD BASE CPP /nologo /Gt0 /W3 /GX /O1 /D "NDEBUG" /D "_WINDOWS" /FD /I "..\\ /D " WIN32" /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MT /Gt0 /W3 /GX /O1 /I "..\\ /D " WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /MT /Gt0 /W3 /GX /O1 /D "NDEBUG" /D "_WINDOWS" /FD /I "..\\ /D " WIN32" /c
# SUBTRACT CPP /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o".\ace.bsc"
@@ -198,9 +206,9 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "LIB\Unicode_Debug"
# PROP Target_Dir ""
CPP=cl.exe
-# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D " WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /FD /c
+# ADD BASE CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /FD /I "..\\ /D " WIN32" /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "..\\ /D " WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /FD /MTd /c
+# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /FD /I /MTd "..\\ /D " WIN32" /c
# SUBTRACT CPP /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o".\ace.bsc"
@@ -222,9 +230,9 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "LIB\Unicode_Release"
# PROP Target_Dir ""
CPP=cl.exe
-# ADD BASE CPP /nologo /Gt0 /W3 /GX /O1 /I "..\\ /D " WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /FD /c
+# ADD BASE CPP /nologo /Gt0 /W3 /GX /O1 /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /FD /I "..\\ /D " WIN32" /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MT /Gt0 /W3 /GX /O1 /I "..\\ /D " WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /FD /c
+# ADD CPP /nologo /MT /Gt0 /W3 /GX /O1 /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /FD /I "..\\ /D " WIN32" /c
# SUBTRACT CPP /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o".\ace.bsc"
@@ -869,6 +877,29 @@ DEP_CPP_ASYNC=\
# End Source File
# Begin Source File
+SOURCE=.\Asynch_IO_Impl.cpp
+
+!IF "$(CFG)" == "ACE static library - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Unicode Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Unicode Release"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\Basic_Types.cpp
!IF "$(CFG)" == "ACE static library - Win32 Debug"
@@ -14334,6 +14365,52 @@ DEP_CPP_WFMO_=\
# End Source File
# Begin Source File
+SOURCE=.\WIN32_Asynch_IO.cpp
+
+!IF "$(CFG)" == "ACE static library - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Unicode Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Unicode Release"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\WIN32_Proactor.cpp
+
+!IF "$(CFG)" == "ACE static library - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Unicode Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Unicode Debug"
+
+!ELSEIF "$(CFG)" == "ACE static library - Win32 Alpha Unicode Release"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\XtReactor.cpp
!IF "$(CFG)" == "ACE static library - Win32 Debug"
@@ -14523,6 +14600,10 @@ SOURCE=.\Asynch_IO.h
# End Source File
# Begin Source File
+SOURCE=.\Asynch_IO_Impl.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Auto_Ptr.h
# End Source File
# Begin Source File
@@ -14851,6 +14932,10 @@ SOURCE=.\Proactor.h
# End Source File
# Begin Source File
+SOURCE=.\Proactor_Impl.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Process.h
# End Source File
# Begin Source File
@@ -14915,6 +15000,10 @@ SOURCE=.\Service_Object.h
# End Source File
# Begin Source File
+SOURCE=.\Service_Record.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Service_Repository.h
# End Source File
# Begin Source File
@@ -15203,6 +15292,14 @@ SOURCE=.\UPIPE_Stream.h
# End Source File
# Begin Source File
+SOURCE=.\WIN32_Asynch_IO.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\WIN32_Proactor.h
+# End Source File
+# Begin Source File
+
SOURCE=.\ws2tcpip.h
# End Source File
# Begin Source File
@@ -15247,6 +15344,10 @@ SOURCE=.\Asynch_IO.i
# End Source File
# Begin Source File
+SOURCE=.\Asynch_IO_Impl.i
+# End Source File
+# Begin Source File
+
SOURCE=.\Atomic_Op.i
# End Source File
# Begin Source File
@@ -15547,6 +15648,10 @@ SOURCE=.\Service_Object.i
# End Source File
# Begin Source File
+SOURCE=.\Service_Record.i
+# End Source File
+# Begin Source File
+
SOURCE=.\Service_Repository.i
# End Source File
# Begin Source File
@@ -15749,6 +15854,10 @@ SOURCE=.\UPIPE_Connector.i
SOURCE=.\UPIPE_Stream.i
# End Source File
+# Begin Source File
+
+SOURCE=.\WIN32_Proactor.i
+# End Source File
# End Group
# Begin Group "Template Files"