diff options
author | yamuna <yamuna@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-07-29 04:34:26 +0000 |
---|---|---|
committer | yamuna <yamuna@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-07-29 04:34:26 +0000 |
commit | bab183a9df9904457c36ab3645c2cb5a31e5f646 (patch) | |
tree | 86226ff522ccd303797e36ed79ba3ba34c4e0491 | |
parent | edec5e479d4de45dd5b224c8d5ae8b560a9b3994 (diff) | |
download | ATCD-bab183a9df9904457c36ab3645c2cb5a31e5f646.tar.gz |
ChangelogTag: Mon Jul 28 23:30:15 2003 Yamuna Krishnamurthy <yamuna@oomworks.com>
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp | 50 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.h | 1 | ||||
-rwxr-xr-x | TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl | 55 |
3 files changed, 98 insertions, 8 deletions
diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp b/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp index 21404cc8e9c..8762fdb61d7 100644 --- a/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp +++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.cpp @@ -41,7 +41,8 @@ FTP_Client_StreamEndPoint::set_protocol_object (const char *, Client::Client (void) :client_mmdevice_ (&endpoint_strategy_), count_ (0), - address_ (ACE_OS::strdup ("224.9.9.2:12345")), + address_ (0), + peer_addr_str_ (0), fp_ (0), protocol_ (ACE_OS::strdup ("UDP")), frame_rate_ (30) @@ -61,7 +62,7 @@ Client::parse_args (int argc, char **argv) { // Parse command line arguments - ACE_Get_Opt opts (argc,argv,"f:a:p:r:sd"); + ACE_Get_Opt opts (argc,argv,"f:l:a:p:r:sd"); this->use_sfp_ = 0; @@ -73,9 +74,12 @@ Client::parse_args (int argc, case 'f': this->filename_ = ACE_OS::strdup (opts.opt_arg ()); break; - case 'a': + case 'l': this->address_ = ACE_OS::strdup (opts.opt_arg ()); break; + case 'a': + this->peer_addr_str_ = ACE_OS::strdup (opts.opt_arg ()); + break; case 'p': this->protocol_ = ACE_OS::strdup (opts.opt_arg ()); break; @@ -182,7 +186,7 @@ Client::init (int argc, "r"); if (this->fp_ == 0) ACE_ERROR_RETURN ((LM_DEBUG, - "Cannot open output file %s\n", + "Cannot open input file %s\n", this->filename_), -1); @@ -209,8 +213,22 @@ Client::init (int argc, AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS); // Set the address of the ftp client. - ACE_INET_Addr addr (this->address_); - + ACE_INET_Addr* addr; + if (this->address_ != 0) + ACE_NEW_RETURN (addr, + ACE_INET_Addr (this->address_), + -1); + else + { + char buf [BUFSIZ]; + ACE_OS::hostname (buf, + BUFSIZ); + ACE_NEW_RETURN (addr, + ACE_INET_Addr ("5000", + buf), + -1); + } + // Initialize the flowname ACE_NEW_RETURN (this->flowname_, char [BUFSIZ], @@ -226,7 +244,25 @@ Client::init (int argc, "USER_DEFINED", flow_protocol_str, this->protocol_, - &addr); + addr); + + ACE_INET_Addr* peer_addr; + if (this->peer_addr_str_ != 0) + ACE_NEW_RETURN (peer_addr, + ACE_INET_Addr (this->peer_addr_str_), + -1); + else + { + char buf [BUFSIZ]; + ACE_OS::hostname (buf, + BUFSIZ); + ACE_NEW_RETURN (peer_addr, + ACE_INET_Addr ("5050", + buf), + -1); + } + + entry.set_peer_addr (peer_addr); AVStreams::flowSpec flow_spec (1); flow_spec [0] = CORBA::string_dup (entry.entry_to_string ()); diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.h b/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.h index a7c7b0fcab3..cfa78e4de09 100644 --- a/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.h +++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/ftp.h @@ -141,6 +141,7 @@ private: const char *address_; // Address of the ftp client host machine or a multicast address - Default is // UDP multicast addess + const char *peer_addr_str_; TAO_Naming_Client my_naming_client_; // The Naming Service client. diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl index dcb435870a5..4e4dab4e67e 100755 --- a/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl +++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl @@ -20,9 +20,10 @@ $makefile = PerlACE::LocalFile ("Makefile"); unlink $nsior; $NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior"); -$SV = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -f $testfile"); +$SV = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -f udp_output"); $CL = new PerlACE::Process ("ftp", "-ORBInitRef NameService=file://$nsior -f $makefile"); +print STDERR "Using UDP\n"; print STDERR "Starting Naming Service\n"; $NS->Spawn (); @@ -55,6 +56,58 @@ if ($server != 0) { $status = 1; } +$SV = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -f tcp_output"); +$CL = new PerlACE::Process ("ftp", "-ORBInitRef NameService=file://$nsior -f Makefile -p TCP"); + +print STDERR "Using TCP\n"; +print STDERR "Starting Server\n"; + +$SV->Spawn (); + +sleep $sleeptime; + +print STDERR "Starting Client\n"; + +$client = $CL->SpawnWaitKill (200); + +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; +} + +$server = $SV->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; +} + +$SV = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -f rtp_output"); +$CL = new PerlACE::Process ("ftp", "-ORBInitRef NameService=file://$nsior -f $makefile -p RTP/UDP"); + +print STDERR "Using RTP/UDP\n"; +print STDERR "Starting Server\n"; + +$SV->Spawn (); + +sleep $sleeptime; + +print STDERR "Starting Client\n"; + +$client = $CL->SpawnWaitKill (200); + +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; +} + +$server = $SV->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; +} + $nserver = $NS->TerminateWaitKill (5); if ($nserver != 0) { |