diff options
author | yamuna <yamuna@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-05-03 23:25:23 +0000 |
---|---|---|
committer | yamuna <yamuna@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-05-03 23:25:23 +0000 |
commit | 32d038467318135bb1ab256d7523d1b148d591ba (patch) | |
tree | 3d461c06d440e87c1c567c7e3ccf12c465a2e274 | |
parent | 5d053d113c0840d2d60a09f089dd33bda312a636 (diff) | |
download | ATCD-32d038467318135bb1ab256d7523d1b148d591ba.tar.gz |
Removed the ::feof error
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp | 44 |
1 files changed, 13 insertions, 31 deletions
diff --git a/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp b/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp index 965c7fb7d31..94f7e11f149 100644 --- a/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp @@ -1,4 +1,4 @@ -// $Id$ +2/ $Id$ #include "ftp.h" @@ -40,52 +40,36 @@ FTP_Client_Callback::get_timeout (ACE_Time_Value *&tv, tv = timeout; } -count++; - ACE_Message_Block mb; - mb.size (message_size); - mb.wr_ptr (message_size); - if (count == 10) - { - AVStreams::flowSpec stop_spec (1); - ACE_DECLARE_NEW_CORBA_ENV; - CLIENT::instance ()->streamctrl ()->stop (stop_spec,ACE_TRY_ENV); - ACE_CHECK_RETURN (-1); - CLIENT::instance ()->streamctrl ()->destroy (stop_spec,ACE_TRY_ENV); - TAO_AV_CORE::instance ()->stop_run (); - return 0; - } - ACE_hrtime_t stamp = ACE_OS::gethrtime (); - // ACE_Message_Block mb (BUFSIZ); - ACE_OS::memcpy (mb.rd_ptr (), &stamp, sizeof(stamp)); - // ACE_OS::memcpy (this->frame_.rd_ptr (), &stamp, sizeof(stamp)); +int +FTP_Client_Callback::handle_timeout (void *) +{ + printf ("Within handle_timeout\n"); + ACE_Message_Block mb (BUFSIZ); ACE_DEBUG ((LM_DEBUG,"FTP_Client_Callback::get_frame")); - //char *buf = mb.rd_ptr (); - //cerr << "message block size" << mb.size () << endl; - // int n = ACE_OS::fread(buf,1,mb.size (),CLIENT::instance ()->file ()); - //int n = ACE_OS::fread(buf,1,mb.size (),stamp); - /* + char *buf = mb.rd_ptr (); + cerr << "message block size" << mb.size () << endl; + int n = ACE_OS::fread(buf,1,mb.size (),CLIENT::instance ()->file ()); if (n < 0) { ACE_ERROR_RETURN ((LM_ERROR,"FTP_Client_Flow_Handler::fread end of file\n"),-1); } if (n == 0) { - if (::feof (CLIENT::instance ()->file ())) + if (ACE_OSCALL_RETURN (::feof (CLIENT::instance ()->file ()))) { // wait for sometime for the data to be flushed to the other side. this->count_++; if (this->count_ == 2) { - //@@coryan: Remove these code from this method. - //Should be called when the user wants to stop the stream. ACE_DEBUG ((LM_DEBUG,"handle_timeout:End of file\n")); AVStreams::flowSpec stop_spec (1); ACE_DECLARE_NEW_CORBA_ENV; CLIENT::instance ()->streamctrl ()->stop (stop_spec,ACE_TRY_ENV); ACE_CHECK_RETURN (-1); CLIENT::instance ()->streamctrl ()->destroy (stop_spec,ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); TAO_AV_CORE::instance ()->stop_run (); - + return 0; } else return 0; @@ -94,8 +78,7 @@ count++; ACE_ERROR_RETURN ((LM_ERROR,"FTP_Client_Flow_Handler::fread error\n"),-1); } cerr << "read bytes = " << n << endl; - */ - //mb.wr_ptr (n); + mb.wr_ptr (n); int result = this->protocol_object_->send_frame (&mb); if (result < 0) ACE_ERROR_RETURN ((LM_ERROR,"send failed:%p","FTP_Client_Flow_Handler::send \n"),-1); @@ -104,7 +87,6 @@ count++; } - FTP_Client_Producer::FTP_Client_Producer (void) :TAO_FlowProducer ("Data",CLIENT::instance ()->protocols (),CLIENT::instance ()->format ()) { |