diff options
author | naga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-20 20:00:40 +0000 |
---|---|---|
committer | naga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-20 20:00:40 +0000 |
commit | 4c3e6d787bf22129c1d671911ff630ea46bcbdab (patch) | |
tree | 83d9d0da45d7e57fe3a47f3b5519513e2331bb04 | |
parent | f9dd8bc5bfaa3714c295aae7ee7d7643c2d9e9a2 (diff) | |
download | ATCD-4c3e6d787bf22129c1d671911ff630ea46bcbdab.tar.gz |
Changed the BUFSIZ unit to 1 so that the entire file is transferred.
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp | 10 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Multicast/ftp.cpp | 13 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Multicast/ftp.h | 1 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.cpp | 6 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp | 19 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.h | 1 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Pluggable/server.cpp | 5 |
7 files changed, 36 insertions, 19 deletions
diff --git a/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp b/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp index b75a6d26903..c39b903a38f 100644 --- a/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp @@ -73,7 +73,7 @@ FTP_Client_Flow_Handler::handle_timeout (const ACE_Time_Value &tv, ACE_Message_Block mb (BUFSIZ); char *buf = mb.rd_ptr (); cerr << "message block size" << mb.size () << endl; - int n = ACE_OS::fread(buf,mb.size (),1,CLIENT::instance ()->file ()); + int n = ACE_OS::fread(buf,1,mb.size (),CLIENT::instance ()->file ()); if (n < 0) { TAO_AV_CORE::instance ()->reactor ()->cancel_timer (this->timer_id_); @@ -85,15 +85,15 @@ FTP_Client_Flow_Handler::handle_timeout (const ACE_Time_Value &tv, { // wait for sometime for the data to be flushed to the other side. this->count_++; - if (this->count_ == 10) + if (this->count_ == 2) { ACE_DECLARE_NEW_CORBA_ENV; ACE_DEBUG ((LM_DEBUG,"handle_timeout:End of file\n")); AVStreams::flowSpec stop_spec (1); -// stop_spec.length (1); -// stop_spec [0] = CORBA::string_dup (CLIENT::instance ()->flowname ()); 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; } else @@ -103,7 +103,7 @@ FTP_Client_Flow_Handler::handle_timeout (const ACE_Time_Value &tv, ACE_ERROR_RETURN ((LM_ERROR,"FTP_Client_Flow_Handler::fread error\n"),-1); } cerr << "read bytes = " << n << endl; - mb.wr_ptr (n*BUFSIZ); + 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); diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.cpp b/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.cpp index b8578ee8997..ff15edfc45d 100644 --- a/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.cpp @@ -19,6 +19,13 @@ FTP_Client_Callback::handle_stop (void) return this->handler_->stop (); } +int +FTP_Client_Callback::handle_end_stream (void) +{ + TAO_AV_CORE::instance ()->stop_run (); + return 0; +} + FTP_Client_StreamEndPoint::FTP_Client_StreamEndPoint (TAO_ORB_Manager *orb_manager) :orb_manager_ (orb_manager) { @@ -110,7 +117,7 @@ FTP_Client_Flow_Handler::handle_timeout (const ACE_Time_Value &tv, ACE_Message_Block mb (BUFSIZ); char *buf = mb.rd_ptr (); cerr << "message block size" << mb.size () << endl; - int n = ACE_OS::fread(buf,mb.size (),1,CLIENT::instance ()->file ()); + int n = ACE_OS::fread(buf,1,mb.size (),CLIENT::instance ()->file ()); if (n < 0) { TAO_AV_CORE::instance ()->reactor ()->cancel_timer (this->timer_id_); @@ -122,7 +129,7 @@ FTP_Client_Flow_Handler::handle_timeout (const ACE_Time_Value &tv, { // wait for sometime for the data to be flushed to the other side. this->count_++; - if (this->count_ == 10) + if (this->count_ == 2) { ACE_DEBUG ((LM_DEBUG,"handle_timeout:End of file\n")); AVStreams::flowSpec stop_spec (1); @@ -139,7 +146,7 @@ FTP_Client_Flow_Handler::handle_timeout (const ACE_Time_Value &tv, ACE_ERROR_RETURN ((LM_ERROR,"FTP_Client_Flow_Handler::fread error\n"),-1); } cerr << "read bytes = " << n << endl; - mb.wr_ptr (n*BUFSIZ); + 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); diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.h b/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.h index 0b36782eb5a..c55e5ea1308 100644 --- a/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.h +++ b/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.h @@ -39,6 +39,7 @@ public: FTP_Client_Callback (FTP_Client_Flow_Handler *handler); virtual int handle_start (void); virtual int handle_stop (void); + virtual int handle_end_stream (void); protected: FTP_Client_Flow_Handler *handler_; }; diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.cpp b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.cpp index b6e24c16ce4..d83beb67075 100644 --- a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.cpp @@ -73,7 +73,7 @@ FTP_Client_Flow_Handler::handle_timeout (const ACE_Time_Value &tv, ACE_Message_Block mb (BUFSIZ); char *buf = mb.rd_ptr (); cerr << "message block size" << mb.size () << endl; - int n = ACE_OS::fread(buf,mb.size (),1,CLIENT::instance ()->file ()); + int n = ACE_OS::fread(buf,1,mb.size (),CLIENT::instance ()->file ()); if (n < 0) { TAO_AV_CORE::instance ()->reactor ()->cancel_timer (this->timer_id_); @@ -85,7 +85,7 @@ FTP_Client_Flow_Handler::handle_timeout (const ACE_Time_Value &tv, { // wait for sometime for the data to be flushed to the other side. this->count_++; - if (this->count_ == 10) + if (this->count_ == 2) { ACE_DECLARE_NEW_CORBA_ENV; ACE_DEBUG ((LM_DEBUG,"handle_timeout:End of file\n")); @@ -103,7 +103,7 @@ FTP_Client_Flow_Handler::handle_timeout (const ACE_Time_Value &tv, ACE_ERROR_RETURN ((LM_ERROR,"FTP_Client_Flow_Handler::fread error\n"),-1); } cerr << "read bytes = " << n << endl; - mb.wr_ptr (n*BUFSIZ); + 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); diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp b/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp index 329e531698f..eebb33fa009 100644 --- a/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp @@ -19,6 +19,13 @@ FTP_Client_Callback::handle_stop (void) return this->handler_->stop (); } +int +FTP_Client_Callback::handle_end_stream (void) +{ + TAO_AV_CORE::instance ()->stop_run (); + return 0; +} + FTP_Client_StreamEndPoint::FTP_Client_StreamEndPoint (TAO_ORB_Manager *orb_manager) :orb_manager_ (orb_manager) { @@ -110,7 +117,7 @@ FTP_Client_Flow_Handler::handle_timeout (const ACE_Time_Value &/*tv*/, ACE_Message_Block mb (BUFSIZ); char *buf = mb.rd_ptr (); cerr << "message block size" << mb.size () << endl; - int n = ACE_OS::fread(buf,mb.size (),1,CLIENT::instance ()->file ()); + int n = ACE_OS::fread(buf,1,mb.size (),CLIENT::instance ()->file ()); if (n < 0) { TAO_AV_CORE::instance ()->reactor ()->cancel_timer (this->timer_id_); @@ -122,15 +129,17 @@ FTP_Client_Flow_Handler::handle_timeout (const ACE_Time_Value &/*tv*/, { // wait for sometime for the data to be flushed to the other side. this->count_++; - if (this->count_ == 10) + if (this->count_ == 2) { ACE_DEBUG ((LM_DEBUG,"handle_timeout:End of file\n")); AVStreams::flowSpec stop_spec (1); - stop_spec.length (1); ACE_DECLARE_NEW_CORBA_ENV; - stop_spec [0] = CORBA::string_dup (CLIENT::instance ()->flowname ()); + // stop_spec.length (1); + // stop_spec [0] = CORBA::string_dup (CLIENT::instance ()->flowname ()); 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 (); } else return 0; @@ -139,7 +148,7 @@ FTP_Client_Flow_Handler::handle_timeout (const ACE_Time_Value &/*tv*/, ACE_ERROR_RETURN ((LM_ERROR,"FTP_Client_Flow_Handler::fread error\n"),-1); } cerr << "read bytes = " << n << endl; - mb.wr_ptr (n*BUFSIZ); + 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); diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.h b/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.h index df40377a781..2a7383910c6 100644 --- a/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.h +++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.h @@ -39,6 +39,7 @@ public: FTP_Client_Callback (FTP_Client_Flow_Handler *handler); virtual int handle_start (void); virtual int handle_stop (void); + virtual int handle_end_stream (void); protected: FTP_Client_Flow_Handler *handler_; }; diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/server.cpp b/TAO/orbsvcs/tests/AVStreams/Pluggable/server.cpp index 7948921f316..0651087d834 100644 --- a/TAO/orbsvcs/tests/AVStreams/Pluggable/server.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/server.cpp @@ -47,8 +47,7 @@ int FTP_Server_Callback::handle_end_stream (void) { ACE_DEBUG ((LM_DEBUG,"FTP_SFP_Callback::end_stream\n")); - CORBA::ORB_var orb = TAO_AV_CORE::instance ()->orb_manager ()->orb (); - orb->shutdown (); + TAO_AV_CORE::instance ()->stop_run (); return 0; } @@ -134,7 +133,7 @@ Server::run (void) ACE_DECLARE_NEW_CORBA_ENV; ACE_TRY { - this->orb_manager_->run (ACE_TRY_ENV); + TAO_AV_CORE::instance ()->run (); ACE_TRY_CHECK; } ACE_CATCHANY |