diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-03-15 23:32:57 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-03-15 23:32:57 +0000 |
commit | cbbc37651681238615e4a3935496ab74b085fb97 (patch) | |
tree | 8ec3b36fdb7ab72530f24d672116c95c79e09298 /docs/tutorials/009/broadcast_client.cpp | |
parent | aec4807cfcc242a7b8de22a90c1c0be1aab1984a (diff) | |
download | ATCD-TAO-1_1.tar.gz |
This commit was manufactured by cvs2svn to create tag 'TAO-1_1'.TAO-1_1
Diffstat (limited to 'docs/tutorials/009/broadcast_client.cpp')
-rw-r--r-- | docs/tutorials/009/broadcast_client.cpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/docs/tutorials/009/broadcast_client.cpp b/docs/tutorials/009/broadcast_client.cpp deleted file mode 100644 index f14b7db2c9c..00000000000 --- a/docs/tutorials/009/broadcast_client.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// $Id$ - -#include "ace/SOCK_Dgram_Bcast.h" -#include "ace/INET_Addr.h" - -static const u_short PORT = ACE_DEFAULT_SERVER_PORT; - -int -main (int argc, char *argv[]) -{ - ACE_INET_Addr local ((u_short) 0); - ACE_INET_Addr remote (PORT, INADDR_BROADCAST); - ACE_SOCK_Dgram_Bcast dgram; - - if (dgram.open (local) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "open"), - -1); - char buf[BUFSIZ]; - - sprintf (buf, - argc > 1 ? argv[1] : "Hello World!"); - if (dgram.send (buf, - ACE_OS::strlen (buf) + 1, - remote) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "send"), - -1); - ACE_Time_Value timeout (2, 0); - if (dgram.recv (buf, - sizeof (buf), - remote, - 0, - &timeout) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "recv"), - -1); - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) The server at (%s) said (%s)\n", - remote.get_host_name (), - buf)); - return 0; -} |