summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2005-01-09 12:47:06 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2005-01-09 12:47:06 +0000
commitd4bda00574f62d4fec8e9d99f006371c3eeab365 (patch)
tree0d3a774e40b247a85f6f833476c0acad90043940 /examples
parentc21111e903988b47c885104f16b2b52b8b940521 (diff)
downloadATCD-d4bda00574f62d4fec8e9d99f006371c3eeab365.tar.gz
ChangeLogTag: Sun Jan 9 12:45:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'examples')
-rw-r--r--examples/IPC_SAP/TLI_SAP/CPP-ATM-client.cpp24
-rw-r--r--examples/IPC_SAP/TLI_SAP/CPP-ATM-server.cpp30
2 files changed, 27 insertions, 27 deletions
diff --git a/examples/IPC_SAP/TLI_SAP/CPP-ATM-client.cpp b/examples/IPC_SAP/TLI_SAP/CPP-ATM-client.cpp
index 0ea8d549750..6990763a8b0 100644
--- a/examples/IPC_SAP/TLI_SAP/CPP-ATM-client.cpp
+++ b/examples/IPC_SAP/TLI_SAP/CPP-ATM-client.cpp
@@ -1,7 +1,7 @@
// $Id$
#include "ace/TLI_Connector.h"
-#include "ace/ATM_QoS.h"
+#include "ace/ATM_QoS.h"
#include "ace/ATM_Addr.h"
#include "ace/Log_Msg.h"
@@ -11,10 +11,10 @@ ACE_RCSID(TLI_SAP, CPP_ATM_client, "$Id$")
/* ACE_XTI/ATM Client */
-int main (int argc, char *argv[])
+int main (int argc, char *argv[])
{
if (argc < 2)
- ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_ERROR_RETURN ((LM_ERROR,
"Usage: %s [-s selector] hostname [QoS in KB/sec]\n",
argv[0]),
1);
@@ -73,7 +73,7 @@ int main (int argc, char *argv[])
// Initiate timed, non-blocking connection with server.
ACE_TLI_Connector con;
-
+
// Construct QoS options - currently FORE only supports bandwidth
ACE_ATM_QoS qos;
qos.set_rate(cli_stream.get_handle (),
@@ -93,7 +93,7 @@ int main (int argc, char *argv[])
// Not sure why but reuse_addr set to true/1 causes problems for
// FORE/XTI/ATM - this is now handled in ACE_TLI_Connector::connect()
if (con.connect (cli_stream,
- remote_addr,
+ remote_addr,
(ACE_Time_Value *) &ACE_Time_Value::zero,
local_addr,
1,
@@ -127,14 +127,14 @@ int main (int argc, char *argv[])
1);
else
ACE_DEBUG ((LM_DEBUG,
- "connected to %s\n",
+ "connected to %s\n",
remote_addr.addr_to_string ()));
}
// Send data to server (correctly handles "incomplete writes").
-
+
for (int r_bytes;
- (r_bytes = ACE_OS::read (ACE_STDIN, buf, sizeof buf)) > 0;
+ (r_bytes = ACE_OS::read (ACE_STDIN, buf, sizeof buf)) > 0;
)
if (cli_stream.send_n (buf,
r_bytes,
@@ -145,17 +145,17 @@ int main (int argc, char *argv[])
1);
// Explicitly close the connection.
- if (cli_stream.close () == -1)
+ if (cli_stream.close () == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n",
"close"),
-1);
return 0;
-}
+}
#else
-int main (int, char *[])
+int ACE_TMAIN (int, ACE_TCHAR *[])
{
- ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_ERROR_RETURN ((LM_ERROR,
"your platform isn't configured to support XTI/ATM\n"),
1);
}
diff --git a/examples/IPC_SAP/TLI_SAP/CPP-ATM-server.cpp b/examples/IPC_SAP/TLI_SAP/CPP-ATM-server.cpp
index 9be86342ce1..d4d3dec813c 100644
--- a/examples/IPC_SAP/TLI_SAP/CPP-ATM-server.cpp
+++ b/examples/IPC_SAP/TLI_SAP/CPP-ATM-server.cpp
@@ -1,15 +1,15 @@
// $Id$
-#include "ace/TLI_Acceptor.h"
+#include "ace/TLI_Acceptor.h"
#include "ace/ATM_Addr.h"
#include "ace/Log_Msg.h"
ACE_RCSID(TLI_SAP, CPP_ATM_server, "$Id$")
#if defined (ACE_HAS_FORE_ATM_XTI)
-// ACE_TLI Server
+// ACE_TLI Server
-int
+int
main (int argc, char *argv[])
{
ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT);
@@ -33,12 +33,12 @@ main (int argc, char *argv[])
} // switch
} // while getopt
- // Create a server address.
+ // Create a server address.
ACE_ATM_Addr addr;
if (selector_specified)
addr.set_selector(selector);
- // Create a server, reuse the addr.
+ // Create a server, reuse the addr.
ACE_TLI_Acceptor peer_acceptor;
// Not sure why but reuse_addr set to true/1 causes problems for
@@ -54,22 +54,22 @@ main (int argc, char *argv[])
"open"),
-1);
- ACE_TLI_Stream new_stream;
+ ACE_TLI_Stream new_stream;
ACE_DEBUG ((LM_DEBUG,
- "starting server at address %s\n",
+ "starting server at address %s\n",
addr.addr_to_string ()));
- // Performs the iterative server activities
+ // Performs the iterative server activities
- for (;;)
+ for (;;)
{
- char buf[BUFSIZ];
+ char buf[BUFSIZ];
// Create a new ACE_TLI_Stream endpoint (note automatic restart
// if errno == EINTR).
- if (peer_acceptor.accept (new_stream,
+ if (peer_acceptor.accept (new_stream,
&addr,
&timeout) == -1)
{
@@ -77,7 +77,7 @@ main (int argc, char *argv[])
"%p\n",
"accept"));
continue;
- }
+ }
ACE_DEBUG ((LM_DEBUG,
"client %s connected\n",
@@ -85,7 +85,7 @@ main (int argc, char *argv[])
// Read data from client (terminate on error).
- for (int r_bytes;
+ for (int r_bytes;
(r_bytes = new_stream.recv (buf, sizeof buf, 0)) > 0; )
if (ACE_OS::write (ACE_STDOUT,
buf,
@@ -95,7 +95,7 @@ main (int argc, char *argv[])
"ACE::send_n"));
// Close new endpoint (listening endpoint stays open).
- if (new_stream.close () == -1)
+ if (new_stream.close () == -1)
ACE_ERROR ((LM_ERROR,
"%p\n",
"close"));
@@ -105,7 +105,7 @@ main (int argc, char *argv[])
return 0;
}
#else
-int main (int, char *[])
+int ACE_TMAIN (int, ACE_TCHAR *[])
{
ACE_ERROR_RETURN ((LM_ERROR,
"your platform isn't configured to support XTI/ATM\n"),