diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2001-11-21 07:48:20 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2001-11-21 07:48:20 +0000 |
commit | aecff1da0843d054cafd4a21687c00c186429f91 (patch) | |
tree | a11aeb562ee80e97ff45c9df6223f77bb466b1c4 | |
parent | fc627baa3778da918ddbeade63fd789b50b12030 (diff) | |
download | ATCD-aecff1da0843d054cafd4a21687c00c186429f91.tar.gz |
ChangeLogTag: Wed Nov 21 08:44:08 2001 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r-- | ace/OS.h | 4 | ||||
-rw-r--r-- | examples/IPC_SAP/ATM_SAP/CPP-client.cpp | 32 | ||||
-rw-r--r-- | examples/IPC_SAP/ATM_SAP/CPP-server.cpp | 40 | ||||
-rw-r--r-- | examples/IPC_SAP/FIFO_SAP/FIFO-Msg-client.cpp | 6 | ||||
-rw-r--r-- | examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp | 4 | ||||
-rw-r--r-- | examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp | 8 | ||||
-rw-r--r-- | examples/IPC_SAP/FIFO_SAP/FIFO-server.cpp | 4 |
7 files changed, 49 insertions, 49 deletions
@@ -266,9 +266,9 @@ typedef long id_t; // Used by the FIFO tests and the Client_Logging_Handler netsvc. # if !defined (ACE_DEFAULT_RENDEZVOUS) # if defined (ACE_HAS_STREAM_PIPES) -# define ACE_DEFAULT_RENDEZVOUS "/tmp/fifo.ace" +# define ACE_DEFAULT_RENDEZVOUS ACE_LIB_TEXT("/tmp/fifo.ace") # else -# define ACE_DEFAULT_RENDEZVOUS "localhost:20010" +# define ACE_DEFAULT_RENDEZVOUS ACE_LIB_TEXT("localhost:20010") # endif /* ACE_HAS_STREAM_PIPES */ # endif /* ACE_DEFAULT_RENDEZVOUS */ diff --git a/examples/IPC_SAP/ATM_SAP/CPP-client.cpp b/examples/IPC_SAP/ATM_SAP/CPP-client.cpp index e7b371a5801..c4ecf2f97ca 100644 --- a/examples/IPC_SAP/ATM_SAP/CPP-client.cpp +++ b/examples/IPC_SAP/ATM_SAP/CPP-client.cpp @@ -13,15 +13,15 @@ ACE_RCSID(ATM_SAP, CPP_client, "$Id$") /* ACE_ATM Client */ -int main (int argc, char *argv[]) +int main (int argc, ACE_TCHAR *argv[]) { if ( argc < 2 ) - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, "Usage: %s <rate> <PDU> <session> <host> <selector> [ host sel ] ...\n" "\tUse 0 for default values\n", argv[0]), 1); - + int rate = ACE_OS::atoi( argv[ 1 ]); rate = ( rate != 0 ) ? rate : 170000; int pdu_size = ACE_OS::atoi( argv[ 2 ]) * 1024; @@ -29,7 +29,7 @@ int main (int argc, char *argv[]) int session = ACE_OS::atoi( argv[ 3 ]); session = ( session != 0 ) ? session : 100; - ACE_OS::printf( "ATM_Client: rate: %d c/s, PDU: %dB, session: %d pkts\n", + ACE_OS::printf( "ATM_Client: rate: %d c/s, PDU: %dB, session: %d pkts\n", rate, pdu_size, session ); // Record all hosts/selectors @@ -38,12 +38,12 @@ int main (int argc, char *argv[]) ACE_OS::printf( "ATM_Client: Connecting to ...\n" ); for ( int i = 0; i < num_leaves; i++ ) { - hosts[ i ].set( argv[ i*2 + 4 ], - ( argv[ i*2 + 5 ] != 0 ) + hosts[ i ].set( argv[ i*2 + 4 ], + ( argv[ i*2 + 5 ] != 0 ) ? ACE_OS::atoi( argv[ i*2 + 5 ]) : ACE_ATM_Addr::DEFAULT_SELECTOR ); - ACE_OS::printf( "ATM_Client: leaf: %s (%s), sel: %d\n", + ACE_OS::printf( "ATM_Client: leaf: %s (%s), sel: %d\n", argv[ i*2 + 4 ], - hosts[ i ].addr_to_string(), + hosts[ i ].addr_to_string(), hosts[ i ].get_selector()); } @@ -57,7 +57,7 @@ int main (int argc, char *argv[]) ACE_OS::hostname( hostname, MAXNAMELEN ); ACE_ATM_Addr local_addr( hostname, hosts[ 0 ].get_selector()); - ACE_OS::printf( "ATM_Client: local host: %s(%s)\n", + ACE_OS::printf( "ATM_Client: local host: %s(%s)\n", hostname, local_addr.addr_to_string()); // In order to construct connections options the file handle is @@ -78,7 +78,7 @@ int main (int argc, char *argv[]) // Construct QoS options - currently FORE only supports bandwidth ACE_OS::printf( "ATM_Client: specify cell rate at %d c/s\n", rate ); - ACE_ATM_QoS qos; + ACE_ATM_QoS qos; qos.set_rate(atm_stream.get_handle (), rate, ACE_ATM_QoS::OPT_FLAGS_CPID); @@ -120,7 +120,7 @@ int main (int argc, char *argv[]) 1); else ACE_DEBUG ((LM_DEBUG, - "ATM_Client: connected to %s\n", + "ATM_Client: connected to %s\n", hosts[ 0 ].addr_to_string())); } } else { @@ -133,7 +133,7 @@ int main (int argc, char *argv[]) } } /* if num_leaves == 1 */ - + ACE_UINT16 vpi, vci; atm_stream.get_vpi_vci(vpi, vci); ACE_DEBUG ((LM_DEBUG, @@ -184,17 +184,17 @@ int main (int argc, char *argv[]) // Explicitly close the connection. ACE_OS::printf( "ATM_Client: close connection\n" ); - if (atm_stream.close () == -1) + if (atm_stream.close () == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), -1); return 0; -} +} #else -int main (int, char *[]) +int main (int, ACE_TCHAR *[]) { - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, "your platform isn't configured to support ATM\n"), 1); } diff --git a/examples/IPC_SAP/ATM_SAP/CPP-server.cpp b/examples/IPC_SAP/ATM_SAP/CPP-server.cpp index e9c3395d42a..8e0427c421a 100644 --- a/examples/IPC_SAP/ATM_SAP/CPP-server.cpp +++ b/examples/IPC_SAP/ATM_SAP/CPP-server.cpp @@ -10,21 +10,21 @@ ACE_RCSID(ATM_SAP, CPP_ATM_server, "$Id$") #if defined (ACE_HAS_ATM) // ACE_ATM Server -int -main (int argc, char *argv[]) +int +main (int argc, ACE_TCHAR *argv[]) { ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT); //unsigned char selector = ACE_ATM_Addr::DEFAULT_SELECTOR; //int selector_specified = 0; - + if (argc > 2) - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, "Usage: %s [selector]\n", argv[0]), 1); - // Create a server address. + // Create a server address. ACE_ATM_Addr addr; //if (selector_specified) unsigned char selector = ( argc == 2 ) ? ACE_OS::atoi( argv[ 1 ]) : ACE_ATM_Addr::DEFAULT_SELECTOR; @@ -32,13 +32,13 @@ main (int argc, char *argv[]) ACE_OS::printf( "ATM_Server: selector changed to %d\n", addr.get_selector()); - // Create a server, reuse the addr. + // Create a server, reuse the addr. ACE_ATM_Acceptor peer_acceptor; ACE_ATM_Params params; // Not sure why but reuse_addr set to true/1 causes problems for // FORE/XTI/ATM - this is now handled in ACE_ATM_Acceptor::open() - + ACE_HANDLE ret = peer_acceptor.open (addr, 5, params); if ( ret == ACE_INVALID_HANDLE ) ACE_ERROR_RETURN ((LM_ERROR, @@ -46,18 +46,18 @@ main (int argc, char *argv[]) "open"), -1); - ACE_ATM_Stream new_stream; + ACE_ATM_Stream new_stream; ACE_ATM_Addr local_addr; local_addr.set_selector( selector ); peer_acceptor.get_local_addr( local_addr ); ACE_DEBUG ((LM_DEBUG, - "starting server at address %s\n", + "starting server at address %s\n", local_addr.addr_to_string ())); - // Performs the iterative server activities - char buf[BUFSIZ]; + // Performs the iterative server activities + char buf[BUFSIZ]; ACE_High_Res_Timer timer; int total; ACE_Time_Value tv; @@ -69,17 +69,17 @@ main (int argc, char *argv[]) // if errno == EINTR). ACE_OS::printf( "ATM_Server: expecting clients\n" ); - if (peer_acceptor.accept (new_stream, + if (peer_acceptor.accept (new_stream, &addr, &timeout) == -1) { ACE_ERROR ((LM_ERROR, "%p\n", "accept")); continue; - } - + } + ACE_OS::printf( "ATM_Server: got a connection\n" ); - + ACE_UINT16 vpi, vci; vpi = vci = 0; // This has problem on PMP connections on NT @@ -87,7 +87,7 @@ main (int argc, char *argv[]) ACE_DEBUG ((LM_DEBUG, "connected to VPI %d VCI %d\n", vpi, vci)); - + ACE_OS::printf( "ATM_Server: connection accepted\n" ); ACE_DEBUG ((LM_DEBUG, @@ -105,7 +105,7 @@ main (int argc, char *argv[]) total = 0; timer.start_incr(); - for (int r_bytes; + for (int r_bytes; (r_bytes = new_stream.recv (buf, sizeof buf, 0)) > 0; ) { // ACE_OS::printf( "ATM_Server: received %dB\n", r_bytes ); @@ -121,7 +121,7 @@ main (int argc, char *argv[]) break; } - + timer.stop_incr(); timer.elapsed_time_incr( tv ); real_time = tv.sec() * ACE_ONE_SECOND_IN_USECS + tv.usec(); @@ -136,7 +136,7 @@ main (int argc, char *argv[]) } // Close new endpoint (listening endpoint stays open). - if (new_stream.close () == -1) + if (new_stream.close () == -1) ACE_ERROR ((LM_ERROR, "%p\n", "close")); @@ -146,7 +146,7 @@ main (int argc, char *argv[]) return 0; } #else -int main (int, char *[]) +int main (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, "your platform isn't configured to support ATM\n"), diff --git a/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-client.cpp b/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-client.cpp index 962b28d1a11..87c12aa2f4e 100644 --- a/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-client.cpp +++ b/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-client.cpp @@ -6,8 +6,8 @@ ACE_RCSID(FIFO_SAP, FIFO_Msg_client, "$Id$") #if defined (ACE_HAS_STREAM_PIPES) -int -main (int, char *[]) +int +main (int, ACE_TCHAR *[]) { ACE_FIFO_Send_Msg client (ACE_DEFAULT_RENDEZVOUS); @@ -30,7 +30,7 @@ main (int, char *[]) } #else #include <stdio.h> -int main (int, char *[]) +int main (int, ACE_TCHAR *[]) { ACE_OS::fprintf (stderr, "This feature is not supported\n"); return 0; diff --git a/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp b/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp index da6d77496c5..e55e0f36fdf 100644 --- a/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp +++ b/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp @@ -8,7 +8,7 @@ ACE_RCSID(FIFO_SAP, FIFO_Msg_server, "$Id$") #if defined (ACE_HAS_STREAM_PIPES) int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { ACE_OS::unlink (ACE_DEFAULT_RENDEZVOUS); ACE_FIFO_Recv_Msg server (ACE_DEFAULT_RENDEZVOUS); @@ -36,7 +36,7 @@ main (int, char *[]) } #else #include <stdio.h> -int main (int, char *[]) +int main (int, ACE_TCHAR *[]) { ACE_OS::fprintf (stderr, "This feature is not supported\n"); return 0; diff --git a/examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp b/examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp index 5febd714c45..95d7218a45b 100644 --- a/examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp +++ b/examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp @@ -5,16 +5,16 @@ ACE_RCSID(FIFO_SAP, FIFO_client, "$Id$") -int -main (int, char *[]) +int +main (int, ACE_TCHAR *[]) { ACE_FIFO_Send client (ACE_DEFAULT_RENDEZVOUS); - char buf[BUFSIZ]; + ACE_TCHAR buf[BUFSIZ]; while (ACE_OS::fgets (buf, sizeof buf, stdin) != 0) { ssize_t n = ACE_OS::strlen (buf); - + if (client.send (buf, n) != n) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), 1); } diff --git a/examples/IPC_SAP/FIFO_SAP/FIFO-server.cpp b/examples/IPC_SAP/FIFO_SAP/FIFO-server.cpp index bdae6cf45dd..6138a9cc786 100644 --- a/examples/IPC_SAP/FIFO_SAP/FIFO-server.cpp +++ b/examples/IPC_SAP/FIFO_SAP/FIFO-server.cpp @@ -5,8 +5,8 @@ ACE_RCSID(FIFO_SAP, FIFO_server, "$Id$") -int -main (int, char *[]) +int +main (int, ACE_TCHAR *[]) { ACE_OS::unlink (ACE_DEFAULT_RENDEZVOUS); ACE_FIFO_Recv server (ACE_DEFAULT_RENDEZVOUS); |