diff options
-rw-r--r-- | TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h | 6 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp | 3 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Full_Profile/server.cpp | 1 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Latency/control.cpp | 4 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Multicast/ftp.cpp | 9 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Multicast/server.cpp | 3 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.cpp | 18 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/server.cpp | 1 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp | 101 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Pluggable/server.cpp | 30 |
10 files changed, 80 insertions, 96 deletions
diff --git a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h index 695f079237a..05b61228495 100644 --- a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h +++ b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h @@ -706,7 +706,7 @@ protected: // Key used for encryption. u_short mcast_port_; - ACE_UINT32 mcast_addr_; + ACE_CString mcast_addr_; ACE_Hash_Map_Manager <TAO_String_Hash_Key, TAO_FlowSpec_Entry*,ACE_Null_Mutex> mcast_entry_map_; TAO_AV_FlowSpecSet forward_flow_spec_set; TAO_AV_FlowSpecSet reverse_flow_spec_set; @@ -1115,7 +1115,7 @@ public: AVStreams::notConnected)); // drops a flow endpoint from the flow. - int set_mcast_addr (ACE_UINT32 addr,u_short port); + int set_mcast_addr (ACE_CString addr,u_short port); void set_protocol (const char *protocol); protected: typedef ACE_Unbounded_Set<AVStreams::FlowProducer_ptr> FlowProducer_Set; @@ -1135,7 +1135,7 @@ protected: TAO_MCastConfigIf *mcastconfigif_i_; AVStreams::MCastConfigIf_var mcastconfigif_; u_short mcast_port_; - ACE_UINT32 mcast_addr_; + ACE_CString mcast_addr_; CORBA::String_var protocol_; }; diff --git a/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp b/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp index b6da4daddc3..f825ab457a5 100644 --- a/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Full_Profile/ftp.cpp @@ -51,7 +51,7 @@ FTP_Client_Callback::handle_timeout (void *) AVStreams::flowSpec stop_spec (1); CLIENT::instance ()->streamctrl ()->stop (stop_spec,ACE_TRY_ENV); ACE_TRY_CHECK; - CLIENT::instance ()->streamctrl ()->destroy (stop_spec,ACE_TRY_ENV); + //CLIENT::instance ()->streamctrl ()->destroy (stop_spec,ACE_TRY_ENV); TAO_AV_CORE::instance ()->orb ()->shutdown (0); ACE_TRY_CHECK; return 0; @@ -347,7 +347,6 @@ Client::run (void) ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - ACE_DEBUG ((LM_DEBUG, "Exited the TAO_AV_Core::run\n")); } ACE_CATCHANY { diff --git a/TAO/orbsvcs/tests/AVStreams/Full_Profile/server.cpp b/TAO/orbsvcs/tests/AVStreams/Full_Profile/server.cpp index 1205017b7ff..9dfe9cd9959 100644 --- a/TAO/orbsvcs/tests/AVStreams/Full_Profile/server.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Full_Profile/server.cpp @@ -44,6 +44,7 @@ FTP_Server_Callback::handle_stop (void) { ACE_DEBUG ((LM_DEBUG,"FTP_Server_Callback::stop\n")); ACE_OS::fclose (FTP_SERVER::instance ()->file ()); + TAO_AV_CORE::instance ()->orb ()->shutdown (); return 0; } diff --git a/TAO/orbsvcs/tests/AVStreams/Latency/control.cpp b/TAO/orbsvcs/tests/AVStreams/Latency/control.cpp index e1630af76b9..87beba91ccb 100644 --- a/TAO/orbsvcs/tests/AVStreams/Latency/control.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Latency/control.cpp @@ -156,8 +156,8 @@ int main (int argc, char *argv[]) ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - flow_spec.length (0); - stream_control->stop (flow_spec, ACE_TRY_ENV); + // flow_spec.length (0); + // stream_control->stop (flow_spec, ACE_TRY_ENV); ACE_TRY_CHECK; } diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.cpp b/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.cpp index f67d26e4dd0..8155e8c437e 100644 --- a/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Multicast/ftp.cpp @@ -10,7 +10,7 @@ FTP_Client_Callback::FTP_Client_Callback (void) int FTP_Client_Callback::handle_end_stream (void) { - TAO_AV_CORE::instance ()->stop_run (); + TAO_AV_CORE::instance ()->orb ()->shutdown (); return 0; } @@ -56,8 +56,8 @@ FTP_Client_Callback::handle_timeout (void *) //ACE_DECLARE_NEW_CORBA_ENV; CLIENT::instance ()->streamctrl ()->stop (stop_spec,ACE_TRY_ENV); ACE_TRY_CHECK; - CLIENT::instance ()->streamctrl ()->destroy (stop_spec,ACE_TRY_ENV); - ACE_TRY_CHECK; +// CLIENT::instance ()->streamctrl ()->destroy (stop_spec,ACE_TRY_ENV); +// ACE_TRY_CHECK; TAO_AV_CORE::instance ()->orb ()->shutdown (0); ACE_TRY_CHECK; return 0; @@ -176,7 +176,7 @@ Client::streamctrl (void) Client::Client (void) :endpoint_strategy_ (TAO_AV_CORE::instance ()->orb (), TAO_AV_CORE::instance ()->poa (),this), client_mmdevice_ (&endpoint_strategy_), - address_ (ACE_OS::strdup ("224.9.9.2:10002")), + address_ (ACE_OS::strdup ("224.9.9.2:12345")), fp_ (0), protocol_ (ACE_OS::strdup ("UDP")) { @@ -232,7 +232,6 @@ Client::init (int argc,char **argv) this->argv_ = argv; // Increase the debug_level so that we can see the output - // TAO_debug_level++; this->parse_args (this->argc_, this->argv_); if (this->my_naming_client_.init (TAO_AV_CORE::instance ()->orb ()) != 0) diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/server.cpp b/TAO/orbsvcs/tests/AVStreams/Multicast/server.cpp index facb367ea45..ab01e0f1040 100644 --- a/TAO/orbsvcs/tests/AVStreams/Multicast/server.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Multicast/server.cpp @@ -23,6 +23,7 @@ FTP_Server_Callback::handle_stop (void) { ACE_DEBUG ((LM_DEBUG,"FTP_Server_Callback::stop")); ACE_OS::fclose (FTP_SERVER::instance ()->file ()); + TAO_AV_CORE::instance ()->orb ()->shutdown (); return 0; } @@ -48,7 +49,7 @@ FTP_Server_Callback::receive_frame (ACE_Message_Block *frame, int FTP_Server_Callback::handle_end_stream (void) { - ACE_DEBUG ((LM_DEBUG,"FTP_SFP_Callback::end_stream\n")); + ACE_DEBUG ((LM_DEBUG,"FTP_Server_Callback::end_stream\n")); CORBA::ORB_var orb = TAO_AV_CORE::instance ()->orb (); orb->shutdown (); return 0; diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.cpp b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.cpp index 04b4d648b90..ed341875eb4 100644 --- a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/ftp.cpp @@ -10,7 +10,7 @@ FTP_Client_Callback::FTP_Client_Callback (void) int FTP_Client_Callback::handle_end_stream (void) { - TAO_AV_CORE::instance ()->stop_run (); + TAO_AV_CORE::instance ()->orb ()->shutdown (); return 0; } @@ -50,8 +50,9 @@ FTP_Client_Callback::handle_timeout (void *) //ACE_DECLARE_NEW_CORBA_ENV; CLIENT::instance ()->streamctrl ()->stop (stop_spec,ACE_TRY_ENV); ACE_TRY_CHECK; - CLIENT::instance ()->streamctrl ()->destroy (stop_spec,ACE_TRY_ENV); - ACE_TRY_CHECK; + // CLIENT::instance ()->streamctrl ()->destroy (stop_spec,ACE_TRY_ENV); + //ACE_TRY_CHECK; + ACE_DEBUG ((LM_DEBUG, "Just before Orb Shutdown\n")); TAO_AV_CORE::instance ()->orb ()->shutdown (0); ACE_TRY_CHECK; return 0; @@ -249,6 +250,8 @@ Client::init (int argc,char **argv) this->parse_args (this->argc_, this->argv_); + ACE_DEBUG ((LM_DEBUG, "Parsed Address TWO%s\n", this->address_)); + ACE_NEW_RETURN (this->fdev_, FTP_Client_FDev, -1); @@ -302,7 +305,7 @@ Client::run (void) AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS); AVStreams::flowSpec flow_spec (1); // Bind the client and server mmdevices. - + ACE_DEBUG ((LM_DEBUG, "Parsed Address ONE%s\n", this->address_)); ACE_INET_Addr addr (this->address_); TAO_Forward_FlowSpec_Entry entry (this->flowname_, "IN", @@ -319,6 +322,7 @@ Client::run (void) flow_spec, ACE_TRY_ENV); ACE_TRY_CHECK; + ACE_DEBUG ((LM_DEBUG, "Suuceessful ONE\n")); if (result == 0) ACE_ERROR_RETURN ((LM_ERROR,"streamctrl::bind_devs for client_mmdevice failed\n"),-1); if (this->bind_to_server ("Server_MMDevice1") == -1) @@ -330,6 +334,10 @@ Client::run (void) the_qos.inout (), flow_spec, ACE_TRY_ENV); + ACE_TRY_CHECK; + + ACE_DEBUG ((LM_DEBUG, "Suuceessful TWO\n")); + if (result == 0) ACE_ERROR_RETURN ((LM_ERROR,"streamctrl::bind_devs for mmdevice 1 failed\n"),-1); ACE_TRY_CHECK; @@ -343,6 +351,7 @@ Client::run (void) flow_spec, ACE_TRY_ENV); ACE_TRY_CHECK; + ACE_DEBUG ((LM_DEBUG, "Suuceessful THREE\n")); if (result == 0) ACE_ERROR_RETURN ((LM_ERROR,"streamctrl::bind_devs for mmdevice 2 failed\n"),-1); AVStreams::flowSpec start_spec (1); @@ -375,6 +384,7 @@ int main (int argc, char *argv[]) { + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/server.cpp b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/server.cpp index d717b60da14..b9764256d13 100644 --- a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/server.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/server.cpp @@ -40,6 +40,7 @@ FTP_Server_Callback::handle_stop (void) { ACE_DEBUG ((LM_DEBUG,"FTP_Server_Callback::stop")); ACE_OS::fclose (FTP_SERVER::instance ()->file ()); + TAO_AV_CORE::instance ()->orb ()->shutdown (); return 0; } diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp b/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp index 62393c7eac0..aed2a8eecb6 100644 --- a/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp @@ -33,7 +33,7 @@ FTP_Client_Callback::get_timeout (ACE_Time_Value *&tv, { ACE_Time_Value *timeout; ACE_NEW (timeout, - ACE_Time_Value(2)); + ACE_Time_Value(1)); tv = timeout; } @@ -41,69 +41,56 @@ FTP_Client_Callback::get_timeout (ACE_Time_Value *&tv, int FTP_Client_Callback::handle_timeout (void *) { - //@@coryan: Use a preallocated buffer for benchmarks. - //Memory map the file. - 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 (); - TAO_AV_CORE::instance ()->orb ()->shutdown (0); - 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)); - 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); - /* - if (n < 0) - { - ACE_ERROR_RETURN ((LM_ERROR,"FTP_Client_Flow_Handler::fread end of file\n"),-1); - } - if (n == 0) + + ACE_TRY_NEW_ENV { - if (::feof (CLIENT::instance ()->file ())) + ACE_Message_Block mb (BUFSIZ); + char *buf = mb.rd_ptr (); + + 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) { - // wait for sometime for the data to be flushed to the other side. - this->count_++; - if (this->count_ == 2) + if (::feof (CLIENT::instance ()->file ())) { - //@@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); - TAO_AV_CORE::instance ()->stop_run (); - + // 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_TRY_CHECK; + TAO_AV_CORE::instance ()->orb ()->shutdown (0); + ACE_TRY_CHECK; + return 0; + } + else + return 0; } else - return 0; + return 0; } - else - ACE_ERROR_RETURN ((LM_ERROR,"FTP_Client_Flow_Handler::fread error\n"),-1); + + 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); + ACE_DEBUG ((LM_DEBUG,"handle_timeout::buffer sent succesfully\n")); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"FTP_Client_Callback::handle_timeout Failed"); + return -1; } - cerr << "read bytes = " << n << endl; - */ - //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); - ACE_DEBUG ((LM_DEBUG,"handle_timeout::buffer sent succesfully\n")); + ACE_ENDTRY; return 0; } diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/server.cpp b/TAO/orbsvcs/tests/AVStreams/Pluggable/server.cpp index 14b125ccc54..46137da9809 100644 --- a/TAO/orbsvcs/tests/AVStreams/Pluggable/server.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/server.cpp @@ -30,6 +30,7 @@ FTP_Server_Callback::handle_stop (void) { ACE_DEBUG ((LM_DEBUG,"FTP_Server_Callback::stop")); ACE_OS::fclose (FTP_SERVER::instance ()->file ()); + TAO_AV_CORE::instance ()->orb ()->shutdown (); return 0; } @@ -42,28 +43,13 @@ FTP_Server_Callback::receive_frame (ACE_Message_Block *frame, while (frame != 0) { ACE_hrtime_t stamp; - // int result = ACE_OS::fwrite (frame->rd_ptr (), - // frame->length (), - // 1, - // FTP_SERVER::instance ()->file ()); - if (frame->length () < sizeof(stamp)) - return 0; - - ACE_OS::memcpy (&stamp, frame->rd_ptr (), sizeof(stamp)); - - ACE_hrtime_t now = ACE_OS::gethrtime (); - if (recv_base == 0) - { - recv_base = now; - } - else - { - recv_latency.sample (now - recv_base, - now - stamp); - } - - //if (result == 0) - // ACE_ERROR_RETURN ((LM_ERROR,"FTP_Server_Flow_Handler::fwrite failed\n"),-1); + int result = ACE_OS::fwrite (frame->rd_ptr (), + frame->length (), + 1, + FTP_SERVER::instance ()->file ()); + + if (result == 0) + ACE_ERROR_RETURN ((LM_ERROR,"FTP_Server_Flow_Handler::fwrite failed\n"),-1); frame = frame->cont (); } return 0; |