From 2b72b080b25c63ef8b7fc73ee4092cdc02b1d145 Mon Sep 17 00:00:00 2001 From: schmidt Date: Tue, 11 Nov 1997 07:17:34 +0000 Subject: *** empty log message *** --- TAO/ChangeLog-98c | 14 ++++++++------ TAO/tao/orbobj.cpp | 38 +++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index 49830080d6a..97de4978b24 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,11 @@ +Tue Nov 11 01:16:07 1997 Douglas C. Schmidt + + * tao/orbobj.cpp (resolve_name_service): Reformatted the + multicast Name Service locator just a bit. + + * tao/orbconf.h: Started putting a more sane way of automatically + determining the size of various datatypes into TAO. + Tue Nov 11 00:36:39 1997 Sergio Flores * tao/orbobj.cpp (resolve_name_service): changed macro for default @@ -7,13 +15,7 @@ Tue Nov 11 00:36:39 1997 Sergio Flores * tao/orbconf.h: Added some definitions for TAO's default multicast and reply port, and the default timeout value. - -Tue Nov 11 00:06:57 1997 Douglas C. Schmidt - - * tao/orbconf.h: Started putting a more sane way of automatically - determining the size of various datatypes into TAO. - Tue Nov 11 00:00:25 1997 David L. Levine * tests/Cubit/TAO/IDL_Cubit/Makefile: removed MUNCHED because diff --git a/TAO/tao/orbobj.cpp b/TAO/tao/orbobj.cpp index 62cbbcd8440..c7d6975e114 100644 --- a/TAO/tao/orbobj.cpp +++ b/TAO/tao/orbobj.cpp @@ -387,8 +387,6 @@ CORBA_ORB::resolve_name_service (void) // First, see if the user has given us a multicast port number // for the name service on the command-line; u_short port = TAO_ORB_Core_instance ()->orb_params ()->name_service_port (); - char buf[BUFSIZ]; - if (port == 0) { const char *port_number = ACE_OS::getenv ("NameServicePort"); @@ -403,36 +401,38 @@ CORBA_ORB::resolve_name_service (void) // This is the code that implements the multicast // Naming Service locator. ACE_SOCK_Dgram_Mcast multicast; - ACE_INET_Addr multicast_addr, remote_addr; - + + ACE_INET_Addr remote_addr; // This starts out initialized to all zeros! - multicast_addr = ACE_INET_Addr(TAO_DEFAULT_NAME_SERVER_REQUEST_PORT, - ACE_DEFAULT_MULTICAST_ADDR); + ACE_INET_Addr multicast_addr (TAO_DEFAULT_NAME_SERVER_REQUEST_PORT, + ACE_DEFAULT_MULTICAST_ADDR); - // subscribe to multicast address + // Subscribe to multicast address. if (multicast.subscribe (multicast_addr) == -1) return CORBA_Object::_nil (); - // prepare connection for the reply + // Prepare connection for the reply. ACE_INET_Addr response_addr (TAO_DEFAULT_NAME_SERVER_REPLY_PORT); ACE_SOCK_Dgram response (response_addr); - // send multicast of one byte, enough to wake up server - ssize_t retcode = multicast.send (buf, 1); - if (retcode == -1) + // Send multicast of one byte, enough to wake up server. + if (multicast.send ("", 1) == -1) return CORBA_Object::_nil (); - // wait for response until TAO_DEFAULT_NAME_SERVER_TIMEOUT + char buf[BUFSIZ]; + // Wait for response until TAO_DEFAULT_NAME_SERVER_TIMEOUT. ACE_Time_Value timeout (TAO_DEFAULT_NAME_SERVER_TIMEOUT); - if ((retcode = response.recv (buf, - BUFSIZ, - remote_addr, - 0, - &timeout )) == -1) - return CORBA_Object::_nil (); + + ssize_t n_bytes = response.recv (buf, + BUFSIZ, + remote_addr, + 0, + &timeout); + if (n_bytes == -1) + return CORBA_Object::_nil (); // null terminate message - buf[retcode] = 0; + buf[n_bytes] = 0; // convert ior to an object reference CORBA::Environment env; -- cgit v1.2.1