diff options
author | Steve Huston <shuston@riverace.com> | 2004-10-27 21:07:30 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2004-10-27 21:07:30 +0000 |
commit | 4c8a6efdc2fb418184d035aa4090142110b6e923 (patch) | |
tree | 65d03494026685e8a1f1f21f00b11846d88c8bfe /performance-tests | |
parent | e8d6692635980cec76f553e15e00ad3022297dae (diff) | |
download | ATCD-4c8a6efdc2fb418184d035aa4090142110b6e923.tar.gz |
ChangeLogTag:Wed Oct 27 16:22:49 2004 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'performance-tests')
-rw-r--r-- | performance-tests/SCTP/Options_Manager.cpp | 169 | ||||
-rw-r--r-- | performance-tests/SCTP/SCTP.mpc | 43 | ||||
-rw-r--r-- | performance-tests/SCTP/SOCK_SEQPACK_clt.cpp | 52 | ||||
-rw-r--r-- | performance-tests/SCTP/SOCK_SEQPACK_srv.cpp | 82 | ||||
-rw-r--r-- | performance-tests/SCTP/SOCK_STREAM_clt.cpp | 14 | ||||
-rw-r--r-- | performance-tests/SCTP/SOCK_STREAM_srv.cpp | 82 |
6 files changed, 253 insertions, 189 deletions
diff --git a/performance-tests/SCTP/Options_Manager.cpp b/performance-tests/SCTP/Options_Manager.cpp index 8bfbc42a270..a5b3609da36 100644 --- a/performance-tests/SCTP/Options_Manager.cpp +++ b/performance-tests/SCTP/Options_Manager.cpp @@ -1,5 +1,4 @@ // -*- C++ -*- - // $Id$ extern "C" { @@ -61,10 +60,10 @@ Options_Manager::Options_Manager(int argc, ACE_TCHAR **argv, ACE_TCHAR const * c { if (!__initialized) { // Set default values that were not set during static initialization - ACE_OS::strcpy(server_host, "localhost"); + ACE_OS::strcpy(server_host, ACE_LOCALHOST); // Remember argv[0] - if (strlen(argv[0]) < Options_Manager::string_len) + if (ACE_OS::strlen(argv[0]) < Options_Manager::string_len) ACE_OS::strcpy(__program_name, argv[0]); else{ ACE_OS::strncpy(__program_name, argv[0], (Options_Manager::string_len-1)); @@ -74,32 +73,46 @@ Options_Manager::Options_Manager(int argc, ACE_TCHAR **argv, ACE_TCHAR const * c // Declare options with ACE_Get_Opt int c; ACE_Get_Opt * get_opt=NULL; - if (!ACE_OS::strcmp("client-opts", opts_set)){ + if (!ACE_OS::strcmp(ACE_TEXT ("client-opts"), opts_set)){ get_opt = new ACE_Get_Opt(argc, argv, ACE_TEXT("c:nt:m:M:x:b:C:i:p:H:s:h")); - get_opt->long_option("test_iterations", 'c', ACE_Get_Opt::ARG_REQUIRED); - get_opt->long_option("test_enable_nagle", 'n'); - get_opt->long_option("test_transport_protocol", 't', ACE_Get_Opt::ARG_REQUIRED); - get_opt->long_option("histogram_min_bin", 'm', ACE_Get_Opt::ARG_REQUIRED); - get_opt->long_option("histogram_max_bin", 'M', ACE_Get_Opt::ARG_REQUIRED); - get_opt->long_option("histogram_num_outliers", 'x', ACE_Get_Opt::ARG_REQUIRED); - get_opt->long_option("histogram_bin_count", 'b', ACE_Get_Opt::ARG_REQUIRED); - get_opt->long_option("client_port", 'C', ACE_Get_Opt::ARG_REQUIRED); - get_opt->long_option("client_accept_addr", 'i', ACE_Get_Opt::ARG_REQUIRED); - get_opt->long_option("server_port", 'p', ACE_Get_Opt::ARG_REQUIRED); - get_opt->long_option("server_host", 'H', ACE_Get_Opt::ARG_REQUIRED); - get_opt->long_option("payload_size_power_of_2", 's', ACE_Get_Opt::ARG_REQUIRED); - get_opt->long_option("help", 'h'); - } else if (!ACE_OS::strcmp("server-opts", opts_set)){ + get_opt->long_option (ACE_TEXT ("test_iterations"), 'c', + ACE_Get_Opt::ARG_REQUIRED); + get_opt->long_option (ACE_TEXT ("test_enable_nagle"), 'n'); + get_opt->long_option (ACE_TEXT ("test_transport_protocol"), 't', + ACE_Get_Opt::ARG_REQUIRED); + get_opt->long_option (ACE_TEXT ("histogram_min_bin"), 'm', + ACE_Get_Opt::ARG_REQUIRED); + get_opt->long_option (ACE_TEXT ("histogram_max_bin"), 'M', + ACE_Get_Opt::ARG_REQUIRED); + get_opt->long_option (ACE_TEXT ("histogram_num_outliers"), 'x', + ACE_Get_Opt::ARG_REQUIRED); + get_opt->long_option (ACE_TEXT ("histogram_bin_count"), 'b', + ACE_Get_Opt::ARG_REQUIRED); + get_opt->long_option (ACE_TEXT ("client_port"), 'C', + ACE_Get_Opt::ARG_REQUIRED); + get_opt->long_option (ACE_TEXT ("client_accept_addr"), 'i', + ACE_Get_Opt::ARG_REQUIRED); + get_opt->long_option (ACE_TEXT ("server_port"), 'p', + ACE_Get_Opt::ARG_REQUIRED); + get_opt->long_option (ACE_TEXT ("server_host"), 'H', + ACE_Get_Opt::ARG_REQUIRED); + get_opt->long_option (ACE_TEXT ("payload_size_power_of_2"), 's', + ACE_Get_Opt::ARG_REQUIRED); + get_opt->long_option (ACE_TEXT ("help"), 'h'); + } else if (!ACE_OS::strcmp (ACE_TEXT ("server-opts"), opts_set)){ get_opt = new ACE_Get_Opt(argc, argv, ACE_TEXT("nt:p:a:u")); - get_opt->long_option("test_enable_nagle", 'n'); - get_opt->long_option("test_transport_protocol", 't', ACE_Get_Opt::ARG_REQUIRED); - get_opt->long_option("server_port", 'p', ACE_Get_Opt::ARG_REQUIRED); - get_opt->long_option("server_accept_addr", 'a', ACE_Get_Opt::ARG_REQUIRED); - get_opt->long_option("help", 'h'); + get_opt->long_option (ACE_TEXT ("test_enable_nagle"), 'n'); + get_opt->long_option (ACE_TEXT ("test_transport_protocol"), 't', + ACE_Get_Opt::ARG_REQUIRED); + get_opt->long_option (ACE_TEXT ("server_port"), 'p', + ACE_Get_Opt::ARG_REQUIRED); + get_opt->long_option (ACE_TEXT ("server_accept_addr"), 'a', + ACE_Get_Opt::ARG_REQUIRED); + get_opt->long_option (ACE_TEXT ("help"), 'h'); } else { _error = 1; - _error_message = "invalid options set specified"; + _error_message = ACE_TEXT ("invalid options set specified"); delete get_opt; return; } @@ -116,10 +129,10 @@ Options_Manager::Options_Manager(int argc, ACE_TCHAR **argv, ACE_TCHAR const * c test_enable_nagle = 1; break; case 't':{ - char const * const str=get_opt->opt_arg(); - if (!ACE_OS::strcmp(str, "tcp")) + ACE_TCHAR const * const str = get_opt->opt_arg (); + if (!ACE_OS::strcmp (str, ACE_TEXT ("tcp"))) test_transport_protocol = IPPROTO_TCP; - else if (!ACE_OS::strcmp(str, "sctp")) + else if (!ACE_OS::strcmp (str, ACE_TEXT ("sctp"))) test_transport_protocol = IPPROTO_SCTP; else test_transport_protocol = -1; @@ -146,11 +159,11 @@ Options_Manager::Options_Manager(int argc, ACE_TCHAR **argv, ACE_TCHAR const * c // of dotted-decimal ipv4 addresses. // Create a writable copy of the options argument - char str[Options_Manager::string_len]; + ACE_TCHAR str[Options_Manager::string_len]; ACE_OS::strncpy(str, get_opt->opt_arg(), Options_Manager::string_len); // Get a pointer to the first comma in the list - char *next_secondary_addr = ACE_OS::strchr(str, ','); + ACE_TCHAR *next_secondary_addr = ACE_OS::strchr(str, ','); // If found, the comma is replaced with \0 and pointer // updated to point to the string that begins immediately @@ -163,17 +176,18 @@ Options_Manager::Options_Manager(int argc, ACE_TCHAR **argv, ACE_TCHAR const * c // Obtain the 32-bit, host-byte-order representation of // the primary address. struct in_addr foo; - int aton_retval = ACE_OS::inet_aton(str, &foo); + int aton_retval = ACE_OS::inet_aton(ACE_TEXT_ALWAYS_CHAR (str), + &foo); // If this representation was not obtained, terminate with // an error. if (!aton_retval) { - char error_message[Options_Manager::string_len + 100]; - ACE_OS::sprintf(error_message, - "Could not make sense of primary " - "address: %s", - str); + ACE_TCHAR error_message[Options_Manager::string_len + 100]; + ACE_OS::strcpy + (error_message, + ACE_TEXT ("Could not make sense of primary address: ")); + ACE_OS::strcat (error_message, str); _error = 1; _error_message = ACE_OS::strdup(error_message); @@ -207,7 +221,7 @@ Options_Manager::Options_Manager(int argc, ACE_TCHAR **argv, ACE_TCHAR const * c max_num_secondary_connect_addrs) { // Get a pointer to the next comma in the list. - char *next_next_secondary_addr = ACE_OS::strchr(next_secondary_addr, ','); + ACE_TCHAR *next_next_secondary_addr = ACE_OS::strchr(next_secondary_addr, ','); // If found, the comma is replaced with \0 and pointer // updated to point to the string that begins immediately @@ -219,7 +233,9 @@ Options_Manager::Options_Manager(int argc, ACE_TCHAR **argv, ACE_TCHAR const * c // Obtain the 32-bit, host-byte-order representation of // a secondary address. - aton_retval = ACE_OS::inet_aton(next_secondary_addr, &foo); + aton_retval = + ACE_OS::inet_aton(ACE_TEXT_ALWAYS_CHAR (next_secondary_addr), + &foo); // If the representation was obtained without error, // store it in the next available slot of the @@ -230,12 +246,11 @@ Options_Manager::Options_Manager(int argc, ACE_TCHAR **argv, ACE_TCHAR const * c ntohl(foo.s_addr); } else { - char error_message[Options_Manager::string_len + 100]; - ACE_OS::sprintf(error_message, - "Could not make sense of secondary " - "address: %s", - next_secondary_addr); - + ACE_TCHAR error_message[Options_Manager::string_len + 100]; + ACE_OS::strcpy + (error_message, + ACE_TEXT ("Could not make sense of secondary address: ")); + ACE_OS::strcat (error_message, next_secondary_addr); _error = 1; _error_message = ACE_OS::strdup(error_message); break; @@ -261,11 +276,11 @@ Options_Manager::Options_Manager(int argc, ACE_TCHAR **argv, ACE_TCHAR const * c // of dotted-decimal ipv4 addresses. // Create a writable copy of the options argument - char str[Options_Manager::string_len]; + ACE_TCHAR str[Options_Manager::string_len]; ACE_OS::strncpy(str, get_opt->opt_arg(), Options_Manager::string_len); // Get a pointer to the first comma in the list - char *next_secondary_addr = ACE_OS::strchr(str, ','); + ACE_TCHAR *next_secondary_addr = ACE_OS::strchr(str, ','); // If found, the comma is replaced with \0 and pointer // updated to point to the string that begins immediately @@ -278,17 +293,18 @@ Options_Manager::Options_Manager(int argc, ACE_TCHAR **argv, ACE_TCHAR const * c // Obtain the 32-bit, host-byte-order representation of // the primary address. struct in_addr foo; - int aton_retval = ACE_OS::inet_aton(str, &foo); + int aton_retval = ACE_OS::inet_aton (ACE_TEXT_ALWAYS_CHAR (str), + &foo); // If this representation was not obtained, terminate with // an error. if (!aton_retval) { - char error_message[Options_Manager::string_len + 100]; - ACE_OS::sprintf(error_message, - "Could not make sense of primary " - "address: %s", - str); + ACE_TCHAR error_message[Options_Manager::string_len + 100]; + ACE_OS::strcpy + (error_message, + ACE_TEXT ("Could not make sense of primary address: ")); + ACE_OS::strcat (error_message, str); _error = 1; _error_message = ACE_OS::strdup(error_message); @@ -322,7 +338,7 @@ Options_Manager::Options_Manager(int argc, ACE_TCHAR **argv, ACE_TCHAR const * c max_num_secondary_accept_addrs) { // Get a pointer to the next comma in the list. - char *next_next_secondary_addr = ACE_OS::strchr(next_secondary_addr, ','); + ACE_TCHAR *next_next_secondary_addr = ACE_OS::strchr(next_secondary_addr, ','); // If found, the comma is replaced with \0 and pointer // updated to point to the string that begins immediately @@ -334,7 +350,9 @@ Options_Manager::Options_Manager(int argc, ACE_TCHAR **argv, ACE_TCHAR const * c // Obtain the 32-bit, host-byte-order representation of // a secondary address. - aton_retval = ACE_OS::inet_aton(next_secondary_addr, &foo); + aton_retval = + ACE_OS::inet_aton (ACE_TEXT_ALWAYS_CHAR (next_secondary_addr), + &foo); // If the representation was obtained without error, // store it in the next available slot of the @@ -345,11 +363,11 @@ Options_Manager::Options_Manager(int argc, ACE_TCHAR **argv, ACE_TCHAR const * c ntohl(foo.s_addr); } else { - char error_message[Options_Manager::string_len + 100]; - ACE_OS::sprintf(error_message, - "Could not make sense of secondary " - "address: %s", - next_secondary_addr); + ACE_TCHAR error_message[Options_Manager::string_len + 100]; + ACE_OS::strcpy + (error_message, + ACE_TEXT ("Could not make sense of secondary address: ")); + ACE_OS::strcat (error_message, next_secondary_addr); _error = 1; _error_message = ACE_OS::strdup(error_message); @@ -368,8 +386,8 @@ Options_Manager::Options_Manager(int argc, ACE_TCHAR **argv, ACE_TCHAR const * c break; } case 'H':{ - char const * const str=get_opt->opt_arg(); - if (strlen(str) < Options_Manager::string_len) + ACE_TCHAR const * const str=get_opt->opt_arg(); + if (ACE_OS::strlen (str) < Options_Manager::string_len) ACE_OS::strcpy(server_host, str); else{ ACE_OS::strncpy(server_host, str, (Options_Manager::string_len-1)); @@ -390,49 +408,49 @@ Options_Manager::Options_Manager(int argc, ACE_TCHAR **argv, ACE_TCHAR const * c if (test_iterations < 1) { _error = 1; - _error_message = "test_iterations must be no less than than 1"; + _error_message = ACE_TEXT ("test_iterations must be no less than than 1"); } if (histogram_min_bin < 0.0) { _error = 1; - _error_message = "histogram_min_bin must be no less than 0.0"; + _error_message = ACE_TEXT ("histogram_min_bin must be no less than 0.0"); } if (histogram_max_bin < histogram_min_bin) { _error = 1; - _error_message = "histogram_max_bin must be no less than histogram_min_bin"; + _error_message = ACE_TEXT ("histogram_max_bin must be no less than histogram_min_bin"); } if (histogram_num_outliers < 1) { _error = 1; - _error_message = "histogram_num_outliers must be no less than 1"; + _error_message = ACE_TEXT ("histogram_num_outliers must be no less than 1"); } if (histogram_bin_count < 1) { _error = 1; - _error_message = "histogram_bin_count must be no less than 1"; + _error_message = ACE_TEXT ("histogram_bin_count must be no less than 1"); } if ((server_port < 1010 || server_port > 65000) && server_port != 0) { _error = 1; - _error_message = "server_port must be between 1010 and 65000 inclusive, or zero."; + _error_message = ACE_TEXT ("server_port must be between 1010 and 65000 inclusive, or zero."); } - if ((!ACE_OS::strcmp("client-opts", opts_set)) && payload_size_power_of_2 > 17) + if ((!ACE_OS::strcmp(ACE_TEXT ("client-opts"), opts_set)) && payload_size_power_of_2 > 17) { _error = 1; - _error_message = "payload_size_power_of_2 must be specified between 0 and 16 inclusive"; + _error_message = ACE_TEXT("payload_size_power_of_2 must be specified between 0 and 16 inclusive"); } if (test_transport_protocol == -1) { _error = 1; - _error_message = "test_transport_protocol may only take 'sctp' and 'tcp' as values"; + _error_message = ACE_TEXT ("test_transport_protocol may only take 'sctp' and 'tcp' as values"); } __initialized = 1; @@ -451,7 +469,8 @@ void Options_Manager::_show_usage(ostream& out, ACE_TCHAR const * const opts_set for (unsigned int i=0;i<ACE_OS::strlen(__program_name);++i) out << " "; - if (ACE_OS::strstr(__program_name, "SOCK_STREAM_clt") || ACE_OS::strstr(__program_name, "SOCK_STREAM_srv")) { + if (ACE_OS::strstr(__program_name, ACE_TEXT ("SOCK_STREAM_clt")) || + ACE_OS::strstr(__program_name, ACE_TEXT ("SOCK_STREAM_srv")) ) { out << " messaging (SOCK_Stream) using unmarshalled ACE_CDR::Octet." << endl; } else { out << " messaging (SOCK_SEQPACK) using unmarshalled ACE_CDR::Octet." << endl; @@ -461,11 +480,11 @@ void Options_Manager::_show_usage(ostream& out, ACE_TCHAR const * const opts_set out << endl; - if (!ACE_OS::strcmp("client-opts", opts_set)){ + if (!ACE_OS::strcmp (ACE_TEXT ("client-opts"), opts_set)){ out << " Flag Args Option-Name Default" << endl; out << " -c int test-iterations 1000000" << endl; out << " -n none test-enable-nagle NO NAGLING" << endl; - if (ACE_OS::strstr(__program_name, "SOCK_STREAM_clt")) { + if (ACE_OS::strstr(__program_name, ACE_TEXT ("SOCK_STREAM_clt"))) { out << " -t str (sctp|tcp) test-transport-protocol sctp" << endl; } @@ -496,10 +515,10 @@ void Options_Manager::_show_usage(ostream& out, ACE_TCHAR const * const opts_set out << endl; - } else if (!ACE_OS::strcmp("server-opts", opts_set)){ + } else if (!ACE_OS::strcmp(ACE_TEXT ("server-opts"), opts_set)){ out << " Flag Args Option-Name Default" << endl; out << " -n none test-enable-nagle NO NAGLING" << endl; - if (ACE_OS::strstr(__program_name, "SOCK_STREAM_srv")) { + if (ACE_OS::strstr(__program_name, ACE_TEXT ("SOCK_STREAM_srv"))) { out << " -t str (sctp|tcp) test-transport-protocol sctp" << endl; } @@ -507,7 +526,7 @@ void Options_Manager::_show_usage(ostream& out, ACE_TCHAR const * const opts_set out << " -p int server-port 45453" << endl; - if (ACE_OS::strstr(__program_name, "SOCK_SEQPACK_srv")) { + if (ACE_OS::strstr(__program_name, ACE_TEXT ("SOCK_SEQPACK_srv"))) { out << " -a w.x.y.z,a.b.c.d,... server-accept-addr INADDR_ANY" << endl; out << " (comma-separated " << endl; out << " list of one or more " << endl; diff --git a/performance-tests/SCTP/SCTP.mpc b/performance-tests/SCTP/SCTP.mpc new file mode 100644 index 00000000000..2baa7ce0489 --- /dev/null +++ b/performance-tests/SCTP/SCTP.mpc @@ -0,0 +1,43 @@ +// -*- MPC -*- +// $Id$ + +project(*SOCK_STREAM_clt) : aceexe { + exename = SOCK_STREAM_clt + source_files { + SOCK_STREAM_clt.cpp + Options_Manager.cpp + hist.cpp + } +} + +project(*SOCK_STREAM_srv) : aceexe { + exename = SOCK_STREAM_srv + source_files { + SOCK_STREAM_srv.cpp + Options_Manager.cpp + } +} + +project(*SOCK_SEQPACK_clt) : aceexe { + exename = SOCK_SEQPACK_clt + source_files { + SOCK_SEQPACK_clt.cpp + Options_Manager.cpp + hist.cpp + } +} + +project(*SOCK_SEQPACK_srv) : aceexe { + exename = SOCK_SEQPACK_srv + source_files { + SOCK_SEQPACK_srv.cpp + Options_Manager.cpp + } +} + +project(*SOCK_SEQPACK_Association_Test) : aceexe { + exename = SOCK_SEQPACK_Association_Test + source_files { + SOCK_SEQPACK_Association_Test.cpp + } +} diff --git a/performance-tests/SCTP/SOCK_SEQPACK_clt.cpp b/performance-tests/SCTP/SOCK_SEQPACK_clt.cpp index 140efc1784b..f41683da650 100644 --- a/performance-tests/SCTP/SOCK_SEQPACK_clt.cpp +++ b/performance-tests/SCTP/SOCK_SEQPACK_clt.cpp @@ -41,26 +41,26 @@ ACE_UINT32 const microsec_clock_scale_factor = ACE_High_Res_Timer::global_scale_ // file readability. HIST runTest(ACE_SOCK_SEQPACK_Association &); -int main(int argc, char **argv){ +int ACE_TMAIN (int argc, ACE_TCHAR **argv){ // Initialize the options manager - Options_Manager optsMgr(argc, argv, "client-opts"); + Options_Manager optsMgr(argc, argv, ACE_TEXT ("client-opts")); // show usage is requested if (optsMgr._usage) { - optsMgr._show_usage(cerr, "client-opts"); + optsMgr._show_usage(cerr, ACE_TEXT ("client-opts")); return 1; } #ifndef ACE_HAS_SCTP ACE_ERROR_RETURN((LM_ERROR, - "SCTP was NOT installed/accessible when this binary was compiled.\n"), + ACE_TEXT ("SCTP was NOT installed/accessible when this binary was compiled.\n")), 1); #endif // check that valid options were specified if (optsMgr._error) { - cerr << "ERROR: " << optsMgr._error_message << endl; + cerr << "ERROR: " << ACE_TEXT_ALWAYS_CHAR (optsMgr._error_message) << endl; return 1; } @@ -89,8 +89,8 @@ int main(int argc, char **argv){ 0,clientAddr, 0, 0, 0, optsMgr.test_transport_protocol) == -1) /*, // ALL DEFAULT ARGUMENTS Options_Manager::test_transport_protocol) == -1) */ ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) %p\n", - "connection failed"), + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("connection failed")), 1); // run the test @@ -174,8 +174,8 @@ HIST runUnmarshalledOctetTest(ACE_CDR::Octet *buf, size_t seqLen, ACE_SOCK_SEQPA nagle=1; if (-1 == stream.set_option(IPPROTO_SCTP, SCTP_NODELAY, &nagle, sizeof nagle)) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "set_option"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("set_option")), 0); // prime the client and server before starting the test @@ -186,23 +186,23 @@ HIST runUnmarshalledOctetTest(ACE_CDR::Octet *buf, size_t seqLen, ACE_SOCK_SEQPA ACE_CDR::ULong msgLenExpressed = ACE_HTONL(msgLen); if (-1 == stream.send_n (&msgLenExpressed, ACE_CDR::LONG_SIZE, 0, &bt)) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "send_n"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("send_n")), 0); // send a message if (-1 == stream.send_n (buf, msgLen, 0, &bt)) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "send_n"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("send_n")), 0); // block for a Short reply ACE_CDR::Short reply; if ((stream.recv_n(&reply, ACE_CDR::SHORT_SIZE, 0, &bt)) == -1) ACE_ERROR_RETURN((LM_ERROR, - "%p\n", - "recv_n"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("recv_n")), 0); } @@ -211,8 +211,8 @@ HIST runUnmarshalledOctetTest(ACE_CDR::Octet *buf, size_t seqLen, ACE_SOCK_SEQPA aceStream_hist = createHistogram(msgLen); if (NULL == aceStream_hist) ACE_ERROR_RETURN((LM_ERROR, - "%p\n", - "histogram create failed"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("histogram create failed")), 0); iovec iov[2]; @@ -223,8 +223,8 @@ HIST runUnmarshalledOctetTest(ACE_CDR::Octet *buf, size_t seqLen, ACE_SOCK_SEQPA startTime = ACE_OS::gethrtime(); if (!startTime) ACE_ERROR_RETURN((LM_ERROR, - "%p\n", - "ACE_OS::gethrtime()"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("ACE_OS::gethrtime()")), 0); ACE_CDR::ULong msgLenExpressed = ACE_HTONL(msgLen); @@ -235,24 +235,24 @@ HIST runUnmarshalledOctetTest(ACE_CDR::Octet *buf, size_t seqLen, ACE_SOCK_SEQPA if (-1 == stream.sendv_n (iov, 2)) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "send_n"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("send_n")), 0); // block for a Short reply ACE_CDR::Short reply; if ((stream.recv_n(&reply, ACE_CDR::SHORT_SIZE, 0, &bt)) == -1) ACE_ERROR_RETURN((LM_ERROR, - "%p\n", - "recv_n"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("recv_n")), 0); // get the end time endTime = ACE_OS::gethrtime(); if (!endTime) ACE_ERROR_RETURN((LM_ERROR, - "%p\n", - "ACE_OS::gethrtime()"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("ACE_OS::gethrtime()")), 0); // compute the message latency in micro-seconds @@ -294,7 +294,7 @@ HIST runTest(ACE_SOCK_SEQPACK_Association & stream) // send a header to the server that contains test parameters if (sendHeader(stream) < 0) ACE_ERROR_RETURN((LM_ERROR, - "Could NOT Send CDR Encoded Header"), + ACE_TEXT ("Could NOT Send CDR Encoded Header")), 0); // create the forward message buffer diff --git a/performance-tests/SCTP/SOCK_SEQPACK_srv.cpp b/performance-tests/SCTP/SOCK_SEQPACK_srv.cpp index 2e34329f788..105bbb14fab 100644 --- a/performance-tests/SCTP/SOCK_SEQPACK_srv.cpp +++ b/performance-tests/SCTP/SOCK_SEQPACK_srv.cpp @@ -59,8 +59,8 @@ static ACE_THR_FUNC_RETURN unmarshalledOctetServer (void *arg){ // read the size of the buffer to follow if ((dataModeStream->recv_n(&msgBufSize, ACE_CDR::LONG_SIZE, 0, &bt)) == -1) ACE_ERROR_RETURN((LM_ERROR, - "%p\n", - "recv_n"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("recv_n")), 0); msgBufSize = ACE_NTOHL(msgBufSize); @@ -73,8 +73,8 @@ static ACE_THR_FUNC_RETURN unmarshalledOctetServer (void *arg){ // read the buffer if ((dataModeStream->recv_n(msgBuf, msgBufSize, 0, &bt)) == -1) ACE_ERROR_RETURN((LM_ERROR, - "%p\n", - "recv_n"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("recv_n")), 0); // clean up the allocated buffer @@ -86,8 +86,8 @@ static ACE_THR_FUNC_RETURN unmarshalledOctetServer (void *arg){ ACE_CDR::Short reply; if ((dataModeStream->send_n(&reply, ACE_CDR::SHORT_SIZE, 0, &bt)) == -1) ACE_ERROR_RETURN((LM_ERROR, - "%p\n", - "send_n"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("send_n")), 0); } while (--numIterations); @@ -112,8 +112,8 @@ static void run_server (ACE_HANDLE handle) // Make sure we're not in non-blocking mode. if (dataModeStream->disable (ACE_NONBLOCK) == -1){ ACE_ERROR ((LM_ERROR, - "%p\n", - "disable")); + ACE_TEXT ("%p\n"), + ACE_TEXT ("disable"))); return; } else if (dataModeStream->get_remote_addr (cli_addr) == -1){ @@ -135,13 +135,13 @@ static void run_server (ACE_HANDLE handle) if (-1 == dataModeStream->set_option(IPPROTO_SCTP, SCTP_NODELAY, &nagle, sizeof nagle)){ // can't ise ACE_ERROR_RETURN b/c function has void return value ACE_ERROR((LM_ERROR, - "%p\n", - "set_option")); + ACE_TEXT ("%p\n"), + ACE_TEXT ("set_option"))); return; } ACE_DEBUG ((LM_DEBUG, - "(%P|%t) client %s connected from %d\n", + ACE_TEXT("(%P|%t) client %C connected from %d\n"), cli_addr.get_host_name (), cli_addr.get_port_number ())); @@ -158,8 +158,8 @@ static void run_server (ACE_HANDLE handle) // read the header if ((dataModeStream->recv_n(hdrBuf_a, hdrBufSize, 0, &bt)) == -1){ ACE_ERROR ((LM_ERROR, - "%p\n", - "recv_n")); + ACE_TEXT ("%p\n"), + ACE_TEXT ("recv_n"))); return; } @@ -179,14 +179,14 @@ static void run_server (ACE_HANDLE handle) // make sure the stream is good after the extractions if (!hdrCDR.good_bit()){ ACE_ERROR((LM_ERROR, - "%p\n", - "hdrCDR")); + ACE_TEXT ("%p\n"), + ACE_TEXT ("hdrCDR"))); return; } ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Test for %u iterations\n", + ACE_TEXT ("(%P|%t) Test for %u iterations\n"), numIterations)); // deallocate the header buffer @@ -204,34 +204,34 @@ static void run_server (ACE_HANDLE handle) ACE_reinterpret_cast(void *,args), THR_DETACHED) == -1) ACE_ERROR ((LM_ERROR, - "(%P|%t) %p\n", - "spawn")); + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("spawn"))); #else (*unmarshalledOctetServer) (ACE_reinterpret_cast(void *, args)); #endif /* ACE_HAS_THREADS */ } -int main(int argc, char **argv){ +int ACE_TMAIN (int argc, ACE_TCHAR **argv){ - Options_Manager optsMgr(argc, argv, "server-opts"); + Options_Manager optsMgr(argc, argv, ACE_TEXT ("server-opts")); // show usage is requested if (optsMgr._usage) { - optsMgr._show_usage(cerr, "server-opts"); + optsMgr._show_usage(cerr, ACE_TEXT ("server-opts")); return 1; } #ifndef ACE_HAS_SCTP // SCTP is not installed. Exit with informative error message. ACE_ERROR_RETURN((LM_ERROR, - "SCTP was NOT installed/accessible when this binary was compiled.\n"), + ACE_TEXT ("SCTP was NOT installed/accessible when this binary was compiled.\n")), 1); #endif // check that valid options were specified if (optsMgr._error) { - cerr << "ERROR: " << optsMgr._error_message << endl; + cerr << "ERROR: " << ACE_TEXT_ALWAYS_CHAR (optsMgr._error_message) << endl; return 1; } @@ -259,8 +259,8 @@ int main(int argc, char **argv){ ACE_DEFAULT_BACKLOG, optsMgr.test_transport_protocol) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "open"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("open")), 1); // this function checks that the port that was actually bound was @@ -269,24 +269,26 @@ int main(int argc, char **argv){ // used. if (acceptor_socket.get_local_addr(serverAddr) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "get_local_addr"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("get_local_addr")), 1); sockaddr_in *addresses = new sockaddr_in[ 1 + serverAddr.get_num_secondary_addresses() ]; serverAddr.get_addresses( addresses, 1 + serverAddr.get_num_secondary_addresses() ) ; - ACE_DEBUG((LM_DEBUG, - "(%P|%t) Accepting connections, using %s on port %u " - "on interfaces %s", + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) Accepting connections, using %C on ") + ACE_TEXT ("port %u on interfaces %C"), (optsMgr.test_transport_protocol == IPPROTO_SCTP) ? "IPPROTO_SCTP" : "IPPROTO_TCP", serverAddr.get_port_number(), ACE_OS::inet_ntoa( addresses[0].sin_addr) )); unsigned int i; for(i=1; i <= serverAddr.get_num_secondary_addresses() ; ++i ) { - ACE_DEBUG((LM_DEBUG, " and %s", ACE_OS::inet_ntoa( addresses[i].sin_addr) )); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT (" and %C"), + ACE_OS::inet_ntoa (addresses[i].sin_addr))); } - ACE_DEBUG((LM_DEBUG, "\n" )); + ACE_DEBUG((LM_DEBUG, ACE_TEXT ("\n"))); delete[] addresses; @@ -319,31 +321,31 @@ int main(int argc, char **argv){ // check that select did not end with an error. if (result == -1) ACE_ERROR ((LM_ERROR, - "(%P|%t) %p\n", - "select")); + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("select"))); // check to see if select timed out. else if (result == 0){ ACE_DEBUG ((LM_DEBUG, - "(%P|%t) select timed out\n")); + ACE_TEXT ("(%P|%t) select timed out\n"))); } else { // case where a file descriptor was actually set if (!(temp.is_set(acceptor_socket.get_handle()))){ // CANNOT BE REACHED ACE_ERROR ((LM_ERROR, - "(%P|%t) %p\n", - "select: NO ERROR BUT NO FD SET")); + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("select: NO ERROR BUT NO FD SET"))); } else { // call accept to set up the new stream. if (acceptor_socket.accept(new_stream) == -1) { ACE_ERROR ((LM_ERROR, - "%p\n", - "accept")); + ACE_TEXT ("%p\n"), + ACE_TEXT ("accept"))); continue; } else{ ACE_DEBUG ((LM_DEBUG, - "(%P|%t) spawning server\n")); + ACE_TEXT ("(%P|%t) spawning server\n"))); } // Run the server. diff --git a/performance-tests/SCTP/SOCK_STREAM_clt.cpp b/performance-tests/SCTP/SOCK_STREAM_clt.cpp index 55fd85c2c15..ef59ac6f932 100644 --- a/performance-tests/SCTP/SOCK_STREAM_clt.cpp +++ b/performance-tests/SCTP/SOCK_STREAM_clt.cpp @@ -42,14 +42,14 @@ ACE_UINT32 const microsec_clock_scale_factor = ACE_High_Res_Timer::global_scale_ // file readability. HIST runTest(ACE_SOCK_Stream &); -int main(int argc, char **argv){ +int ACE_TMAIN (int argc, ACE_TCHAR **argv){ // Initialize the options manager - Options_Manager optsMgr(argc, argv, "client-opts"); + Options_Manager optsMgr(argc, argv, ACE_TEXT ("client-opts")); // show usage if requested if (optsMgr._usage) { - optsMgr._show_usage(cerr, "client-opts"); + optsMgr._show_usage(cerr, ACE_TEXT ("client-opts")); return 1; } @@ -58,13 +58,13 @@ int main(int argc, char **argv){ #ifndef ACE_HAS_SCTP if (optsMgr.test_transport_protocol == IPPROTO_SCTP) ACE_ERROR_RETURN((LM_ERROR, - "SCTP was NOT installed when this binary was compiled.\nSOCK_STREAM_clt may still be run using TCP via the '-t tcp' option.\n"), + ACE_TEXT ("SCTP was NOT installed when this binary was compiled.\nSOCK_STREAM_clt may still be run using TCP via the '-t tcp' option.\n")), 1); #endif // check that valid options were specified if (optsMgr._error) { - cerr << "ERROR: " << optsMgr._error_message << endl; + cerr << "ERROR: " << ACE_TEXT_ALWAYS_CHAR (optsMgr._error_message) << endl; return 1; } @@ -89,8 +89,8 @@ int main(int argc, char **argv){ 0,clientAddr, 0, 0, 0, // ALL DEFAULT ARGUMENTS Options_Manager::test_transport_protocol) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) %p\n", - "connection failed"), + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("connection failed")), 1); // run the test diff --git a/performance-tests/SCTP/SOCK_STREAM_srv.cpp b/performance-tests/SCTP/SOCK_STREAM_srv.cpp index 1e04d41807d..5c75a2585fe 100644 --- a/performance-tests/SCTP/SOCK_STREAM_srv.cpp +++ b/performance-tests/SCTP/SOCK_STREAM_srv.cpp @@ -58,8 +58,8 @@ static ACE_THR_FUNC_RETURN unmarshalledOctetServer (void *arg){ // read the size of the buffer to follow if ((dataModeStream->recv_n(&msgBufSize, ACE_CDR::LONG_SIZE, 0, &bt)) == -1) ACE_ERROR_RETURN((LM_ERROR, - "%p\n", - "recv_n"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("recv_n")), 0); msgBufSize = ACE_NTOHL(msgBufSize); @@ -72,8 +72,8 @@ static ACE_THR_FUNC_RETURN unmarshalledOctetServer (void *arg){ // read the buffer if ((dataModeStream->recv_n(msgBuf, msgBufSize, 0, &bt)) == -1) ACE_ERROR_RETURN((LM_ERROR, - "%p\n", - "recv_n"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("recv_n")), 0); // clean up the allocated buffer @@ -85,8 +85,8 @@ static ACE_THR_FUNC_RETURN unmarshalledOctetServer (void *arg){ ACE_CDR::Short reply; if ((dataModeStream->send_n(&reply, ACE_CDR::SHORT_SIZE, 0, &bt)) == -1) ACE_ERROR_RETURN((LM_ERROR, - "%p\n", - "send_n"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("send_n")), 0); } while (--numIterations); @@ -111,14 +111,14 @@ static void run_server (ACE_HANDLE handle) // Make sure we're not in non-blocking mode. if (dataModeStream->disable (ACE_NONBLOCK) == -1){ ACE_ERROR ((LM_ERROR, - "%p\n", - "disable")); + ACE_TEXT ("%p\n"), + ACE_TEXT ("disable"))); return; } else if (dataModeStream->get_remote_addr (cli_addr) == -1){ ACE_ERROR ((LM_ERROR, - "%p\n", - "get_remote_addr")); + ACE_TEXT ("%p\n"), + ACE_TEXT ("get_remote_addr"))); return; } @@ -135,8 +135,8 @@ static void run_server (ACE_HANDLE handle) // default - sctp case if (-1 == dataModeStream->set_option(IPPROTO_SCTP, SCTP_NODELAY, &nagle, sizeof nagle)){ ACE_ERROR((LM_ERROR, - "%p\n", - "set_option")); + ACE_TEXT ("%p\n"), + ACE_TEXT ("set_option"))); return; } } else { @@ -150,7 +150,7 @@ static void run_server (ACE_HANDLE handle) } ACE_DEBUG ((LM_DEBUG, - "(%P|%t) client %s connected from %d\n", + ACE_TEXT ("(%P|%t) client %C connected from %d\n"), cli_addr.get_host_name (), cli_addr.get_port_number ())); @@ -167,8 +167,8 @@ static void run_server (ACE_HANDLE handle) // read the header if ((dataModeStream->recv_n(hdrBuf_a, hdrBufSize, 0, &bt)) == -1){ ACE_ERROR ((LM_ERROR, - "%p\n", - "recv_n")); + ACE_TEXT ("%p\n"), + ACE_TEXT ("recv_n"))); return; } @@ -188,14 +188,14 @@ static void run_server (ACE_HANDLE handle) // make sure the stream is good after the extractions if (!hdrCDR.good_bit()){ ACE_ERROR((LM_ERROR, - "%p\n", - "hdrCDR")); + ACE_TEXT ("%p\n"), + ACE_TEXT ("hdrCDR"))); return; } ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Test for %u iterations\n", + ACE_TEXT ("(%P|%t) Test for %u iterations\n"), numIterations)); // deallocate the header buffer @@ -213,21 +213,21 @@ static void run_server (ACE_HANDLE handle) ACE_reinterpret_cast(void *,args), THR_DETACHED) == -1) ACE_ERROR ((LM_ERROR, - "(%P|%t) %p\n", - "spawn")); + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("spawn"))); #else (*unmarshalledOctetServer) (ACE_reinterpret_cast(void *, args)); #endif /* ACE_HAS_THREADS */ } -int main(int argc, char **argv){ +int ACE_TMAIN (int argc, ACE_TCHAR **argv){ - Options_Manager optsMgr(argc, argv, "server-opts"); + Options_Manager optsMgr(argc, argv, ACE_TEXT ("server-opts")); // show usage is requested if (optsMgr._usage) { - optsMgr._show_usage(cerr, "server-opts"); + optsMgr._show_usage(cerr, ACE_TEXT ("server-opts")); return 1; } @@ -236,15 +236,15 @@ int main(int argc, char **argv){ #ifndef ACE_HAS_SCTP if (optsMgr.test_transport_protocol == IPPROTO_SCTP) ACE_ERROR_RETURN((LM_ERROR, - "SCTP was NOT installed when this binary was compiled.\n" - "SOCK_STREAM_srv may still be run using TCP " - "via the '-t tcp' option.\n"), + ACE_TEXT ("SCTP was NOT installed when this binary was compiled.\n") + ACE_TEXT ("SOCK_STREAM_srv may still be run using TCP ") + ACE_TEXT ("via the '-t tcp' option.\n")), 1); #endif // check that valid options were specified if (optsMgr._error) { - cerr << "ERROR: " << optsMgr._error_message << endl; + cerr << "ERROR: " << ACE_TEXT_ALWAYS_CHAR (optsMgr._error_message) << endl; return 1; } @@ -259,7 +259,7 @@ int main(int argc, char **argv){ optsMgr.server_accept_addr); ACE_DEBUG((LM_DEBUG, - "(%P|%t) Accepting connections on port %u on interface %s using %s\n", + ACE_TEXT ("(%P|%t) Accepting connections on port %u on interface %C using %C\n"), serverAddr.get_port_number(), (optsMgr.server_accept_addr == INADDR_ANY) ? "INADDR_ANY" : serverAddr.get_host_addr(), (optsMgr.test_transport_protocol == IPPROTO_SCTP) ? "IPPROTO_SCTP" : "IPPROTO_TCP")); @@ -273,8 +273,8 @@ int main(int argc, char **argv){ ACE_DEFAULT_BACKLOG, optsMgr.test_transport_protocol) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "open"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("open")), 1); // this function checks that the port that was actually bound was @@ -283,12 +283,12 @@ int main(int argc, char **argv){ // used. else if (acceptor_socket.get_local_addr(serverAddr) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "get_local_addr"), + ACE_TEXT ("%p\n"), + ACE_TEXT ("get_local_addr")), 1); ACE_DEBUG ((LM_DEBUG, - "(%P|%t) starting server at port %d\n", + ACE_TEXT ("(%P|%t) starting server at port %d\n"), serverAddr.get_port_number())); // this is the stream object that will associated with a completed @@ -320,31 +320,31 @@ int main(int argc, char **argv){ // check that select did not end with an error. if (result == -1) ACE_ERROR ((LM_ERROR, - "(%P|%t) %p\n", - "select")); + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("select"))); // check to see if select timed out. else if (result == 0){ ACE_DEBUG ((LM_DEBUG, - "(%P|%t) select timed out\n")); + ACE_TEXT ("(%P|%t) select timed out\n"))); } else { // case where a file descriptor was actually set if (!(temp.is_set(acceptor_socket.get_handle()))){ // CANNOT BE REACHED ACE_ERROR ((LM_ERROR, - "(%P|%t) %p\n", - "select: NO ERROR BUT NO FD SET")); + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("select: NO ERROR BUT NO FD SET"))); } else { // call accept to set up the new stream. if (acceptor_socket.accept(new_stream) == -1) { ACE_ERROR ((LM_ERROR, - "%p\n", - "accept")); + ACE_TEXT ("%p\n"), + ACE_TEXT ("accept"))); continue; } else{ ACE_DEBUG ((LM_DEBUG, - "(%P|%t) spawning server\n")); + ACE_TEXT ("(%P|%t) spawning server\n"))); } // Run the server. |