summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests
diff options
context:
space:
mode:
authoryamuna <yamuna@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-11-06 20:09:20 +0000
committeryamuna <yamuna@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-11-06 20:09:20 +0000
commit6d2e1a13725e0e6587f630d5793e80d09f9bdf1a (patch)
treee4fbcdc7057b103b2f472719be87c93e63d79098 /TAO/orbsvcs/tests
parent377be65ff97469281dd7ed36e18ca74de132e082 (diff)
downloadATCD-6d2e1a13725e0e6587f630d5793e80d09f9bdf1a.tar.gz
ChangelogTag: Thu Nov 6 14:54:42 2003 Yamuna Krishnamurthy <yamuna@oomworks.com>
Diffstat (limited to 'TAO/orbsvcs/tests')
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/README13
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp86
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.h15
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/README6
4 files changed, 101 insertions, 19 deletions
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/README b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/README
index 40e3024f5c1..b43bede78cc 100644
--- a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/README
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/README
@@ -24,19 +24,24 @@ receiver -f <output_filename>
sender
------
-sender [-f <filename>] [-p <protocol>] [-r <frame rate>] [-d]
-
+sender [-f <filename>] [-p <protocol>] [-r <frame rate>] [-l <local_address>] [-a <peer_address>] [-d]
-f filename --> The file to be streamed to the receiver (defaults to
"input").
--p protocol --> The protocol string could be UDP or TCP (defaults to
+-p protocol --> The protocol string could be UDP, TCP, RTP/UDP or SCTP_SEQ (defaults to
UDP). But with the multicast address it should be UDP.
-r framerate--> The rate at which tha data frames need to be sent
(defaults to 30 frames per second).
--d --> Increament the TAO_debug_level for debug messages.
+-l address --> Local address in the format host:port. If protocol is SCTP_SEQ then specify ","
+ separated secondary addresses.eg. primary_addr:port,sec_addr1,sec_addr2
+
+-a address --> Destination address in the format host:port. If protocol is SCTP_SEQ then specify ","
+ separated secondary addresses.eg. primary_addr:port,sec_addr1,sec_addr2
+
+-d --> Increment the TAO_debug_level for debug messages.
The test must be run with the naming service. Check the run_test.pl
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp
index 068ce23af05..c23adcb7c0a 100644
--- a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp
@@ -36,7 +36,13 @@ Sender::Sender (void)
input_file_ (0),
protocol_ ("UDP"),
frame_rate_ (30.0),
- mb_ (BUFSIZ)
+ mb_ (1000),
+ address_ (0),
+ peer_address_ (0),
+ local_sec_addrs_ (0),
+ peer_sec_addrs_ (0),
+ num_local_sec_addrs_ (0),
+ num_peer_sec_addrs_ (0)
{
}
@@ -53,7 +59,7 @@ Sender::parse_args (int argc,
char **argv)
{
// Parse command line arguments
- ACE_Get_Opt opts (argc, argv, "f:p:r:d");
+ ACE_Get_Opt opts (argc, argv, "f:p:r:dl:a:");
int c;
while ((c= opts ()) != -1)
@@ -72,7 +78,41 @@ Sender::parse_args (int argc,
case 'd':
TAO_debug_level++;
break;
- default:
+ case 'l':
+ {
+ TAO_Tokenizer addr_token (opts.opt_arg (), ',');
+ this->address_ = CORBA::string_dup (addr_token [0]);
+ num_local_sec_addrs_ = addr_token.num_tokens () - 1;
+ if (num_local_sec_addrs_ != 0)
+ ACE_NEW_RETURN (local_sec_addrs_, char* [num_local_sec_addrs_], -1);
+ for (int j = 1; j <= num_local_sec_addrs_; j++)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "adding addresses to sequence %s\n",
+ addr_token [j]));
+
+ local_sec_addrs_ [j-1] = CORBA::string_dup (addr_token [j]);
+ }
+ }
+ break;
+ case 'a':
+ {
+ TAO_Tokenizer addr_token (opts.opt_arg (), ',');
+ this->peer_address_ = CORBA::string_dup (addr_token [0]);
+ num_peer_sec_addrs_ = addr_token.num_tokens () - 1;
+ if (num_peer_sec_addrs_ != 0)
+ ACE_NEW_RETURN (peer_sec_addrs_, char* [num_peer_sec_addrs_], -1);
+ for (int j = 1; j <= num_peer_sec_addrs_; j++)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "adding addresses to sequence %s\n",
+ addr_token [j]));
+
+ peer_sec_addrs_ [j-1] = CORBA::string_dup (addr_token [j]);
+ }
+ }
+ break;
+ default:
ACE_DEBUG ((LM_DEBUG, "Unknown Option\n"));
return -1;
}
@@ -161,12 +201,19 @@ Sender::init (int argc,
AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS);
// Set the address of the ftp client.
+ ACE_INET_Addr addr;
char buf [BUFSIZ];
- ACE_OS::hostname (buf,
- BUFSIZ);
- ACE_INET_Addr addr ("5000",
- buf);
-
+
+ if (address_ != 0)
+ addr.set (address_);
+ else
+ {
+ ACE_OS::hostname (buf,
+ BUFSIZ);
+ addr.set (8000,
+ buf);
+ }
+
// Create the forward flow specification to describe the flow.
TAO_Forward_FlowSpec_Entry entry ("Data_Receiver",
"IN",
@@ -175,12 +222,23 @@ Sender::init (int argc,
this->protocol_.c_str (),
&addr);
- ACE_OS::hostname (buf,
- BUFSIZ);
- ACE_INET_Addr peer_addr ("5050",
- buf);
+ ACE_INET_Addr peer_addr;
+ if (peer_address_ != 0)
+ peer_addr.set (peer_address_);
+ else
+ {
+ ACE_OS::hostname (buf,
+ BUFSIZ);
+ peer_addr.set (8050,
+ buf);
+ }
+
entry.set_peer_addr (&peer_addr);
+ entry.set_local_sec_addr (local_sec_addrs_, num_local_sec_addrs_);
+
+ entry.set_peer_sec_addr (peer_sec_addrs_, num_peer_sec_addrs_);
+
AVStreams::flowSpec flow_spec (1);
flow_spec.length (1);
flow_spec [0] = CORBA::string_dup (entry.entry_to_string ());
@@ -244,6 +302,7 @@ Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL)
// The time taken for sending a frame and preparing for the next frame
ACE_High_Res_Timer elapsed_timer;
+ char buf [BUFSIZ];
// Continue to send data till the file is read to the end.
while (1)
{
@@ -312,7 +371,8 @@ Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL)
// Send frame.
int result =
- this->protocol_object_->send_frame (&this->mb_);
+ this->protocol_object_->send_frame (buf, 1000);
+ // this->protocol_object_->send_frame (&this->mb_);
if (result < 0)
ACE_ERROR_RETURN ((LM_ERROR,
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.h b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.h
index 6efdcf55afd..64ceca0cc3b 100644
--- a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.h
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.h
@@ -114,4 +114,19 @@ private:
TAO_AV_Protocol_Object *protocol_object_;
// Protocol object corresponding to the transport protocol selected.
+
+ char* address_;
+ // Destination Address.
+
+ char* peer_address_;
+ // Destination Address.
+
+ char** local_sec_addrs_;
+ // Local secondary addresses
+
+ char** peer_sec_addrs_;
+ // Peer secondary addresses
+
+ int num_local_sec_addrs_;
+ int num_peer_sec_addrs_;
};
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/README b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/README
index 243fb4ded87..f20147a4dc5 100644
--- a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/README
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/README
@@ -26,7 +26,7 @@ receiver -f <output_filename>
sender
------
-sender [-f <filename>] [-p <protocol>] [-r <frame rate>] [-a <address>] [-d]
+sender [-f <filename>] [-p <protocol>] [-r <frame rate>] [-l <local_address>] [-a <peer_address>] [-d]
-f filename --> The file to be streamed to the receiver (defaults to
@@ -38,7 +38,9 @@ sender [-f <filename>] [-p <protocol>] [-r <frame rate>] [-a <address>] [-d]
-r framerate--> The rate at which tha data frames need to be sent
(defaults to 30 frames per second).
--a address --> Destination address.
+-l address --> Local address in the format host:port.
+
+-a address --> Destination address in the format host:port.
-d --> Increament the TAO_debug_level for debug messages.