diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-02 06:30:23 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-02 06:30:23 +0000 |
commit | 7d554a4ea68018bd79cf7183f2d178d5e1e8d413 (patch) | |
tree | 59cfd688144ad9bfcb1ddb8eca3200c2dec6dfcf /apps | |
parent | 02f306584023543a554c7ba8a7e1d89ae3595e64 (diff) | |
download | ATCD-7d554a4ea68018bd79cf7183f2d178d5e1e8d413.tar.gz |
Debugging code and fixes added to get ASYNCH IO to accept and read.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/JAWS/PROTOTYPE/JAWS/IO.cpp | 4 | ||||
-rw-r--r-- | apps/JAWS/PROTOTYPE/JAWS/IO_Handler.cpp | 6 | ||||
-rw-r--r-- | apps/JAWS/PROTOTYPE/JAWS/Server.cpp | 8 |
3 files changed, 10 insertions, 8 deletions
diff --git a/apps/JAWS/PROTOTYPE/JAWS/IO.cpp b/apps/JAWS/PROTOTYPE/JAWS/IO.cpp index 0d8f8b6283c..1c8392ff271 100644 --- a/apps/JAWS/PROTOTYPE/JAWS/IO.cpp +++ b/apps/JAWS/PROTOTYPE/JAWS/IO.cpp @@ -270,9 +270,11 @@ JAWS_Asynch_IO::accept (JAWS_IO_Handler *ioh, ACE_Asynch_Accept aa; size_t address_size = sizeof (sockaddr_in) + sizeof (sockaddr); + size_t bytes_to_read = + JAWS_Data_Block::JAWS_DATA_BLOCK_SIZE - (2 * address_size); if (aa.open (*(aioh->handler ()), listen_handle) == -1 - || aa.accept (*ndb, JAWS_Data_Block::JAWS_DATA_BLOCK_SIZE - (2 * address_size)) == -1) + || aa.accept (*ndb, bytes_to_read) == -1) aioh->accept_error (); } diff --git a/apps/JAWS/PROTOTYPE/JAWS/IO_Handler.cpp b/apps/JAWS/PROTOTYPE/JAWS/IO_Handler.cpp index 3527814565f..9e33423611e 100644 --- a/apps/JAWS/PROTOTYPE/JAWS/IO_Handler.cpp +++ b/apps/JAWS/PROTOTYPE/JAWS/IO_Handler.cpp @@ -242,12 +242,14 @@ void JAWS_Asynch_Handler::handle_read_stream (const ACE_Asynch_Read_Stream::Result &result) { - // This callback is for this->receive_file() this->dispatch_handler (); if (result.act () != 0) { + // This callback is for io->receive_file() + JAWS_TRACE ("JAWS_Asynch_Handler::handle_read_stream (recv_file)"); + int code = 0; if (result.success () && result.bytes_transferred () != 0) { @@ -281,6 +283,8 @@ JAWS_Asynch_Handler::handle_read_stream (const ACE_Asynch_Read_Stream::Result else { // This callback is for this->read() + JAWS_TRACE ("JAWS_Asynch_Handler::handle_read_stream (read)"); + if (result.success () && result.bytes_transferred () != 0) this->handler ()->read_complete (&result.message_block ()); diff --git a/apps/JAWS/PROTOTYPE/JAWS/Server.cpp b/apps/JAWS/PROTOTYPE/JAWS/Server.cpp index 28724b2570f..ca6af371fd3 100644 --- a/apps/JAWS/PROTOTYPE/JAWS/Server.cpp +++ b/apps/JAWS/PROTOTYPE/JAWS/Server.cpp @@ -77,6 +77,8 @@ JAWS_Server::init (int argc, char *argv[]) this->policy_.acceptor (JAWS_IO_Synch_Acceptor_Singleton::instance ()); } + ACE_INET_Addr inet_addr (this->port_); + this->policy_.acceptor ()->open (inet_addr); } int @@ -94,12 +96,6 @@ JAWS_Server::open (JAWS_Pipeline_Handler *protocol, return -1; } - ACE_INET_Addr inet_addr (this->port_); - JAWS_IO_Synch_Acceptor_Singleton::instance ()->open (inet_addr); - ACE_HANDLE socket - = JAWS_IO_Synch_Acceptor_Singleton::instance ()->get_handle (); - JAWS_IO_Asynch_Acceptor_Singleton::instance ()->open (socket); - // initialize data block db->task (JAWS_Pipeline_Accept_Task_Singleton::instance ()); |