summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfredk <fredk@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-05-24 23:52:42 +0000
committerfredk <fredk@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-05-24 23:52:42 +0000
commit5164e0082fb013ee89642149b6d5179e2bf7e7c5 (patch)
tree966692104a50610fdfcd7a1985802996f49a78d3
parent15036dd18e62cc25415bba8e5dfca05e750ef04c (diff)
downloadATCD-5164e0082fb013ee89642149b6d5179e2bf7e7c5.tar.gz
Added support for caching host and port.
-rw-r--r--TAO/tao/IIOP_Acceptor.cpp21
-rw-r--r--TAO/tao/IIOP_Acceptor.h9
2 files changed, 29 insertions, 1 deletions
diff --git a/TAO/tao/IIOP_Acceptor.cpp b/TAO/tao/IIOP_Acceptor.cpp
index 7b51933f2b2..0e04e32d910 100644
--- a/TAO/tao/IIOP_Acceptor.cpp
+++ b/TAO/tao/IIOP_Acceptor.cpp
@@ -105,9 +105,12 @@ int
TAO_IIOP_Acceptor::open (TAO_ORB_Core *orb_core,
ACE_CString &address)
{
-
+ // address is in the for host:port
ACE_INET_Addr addr (address.c_str ());
+ // open endpoint. If port ==0 then
+ // calling the open method will cause the system to assign
+ // an ephemeral port number number.
if (this->base_acceptor_.open (
// orb_core->orb_params ()->addr (),
addr,
@@ -118,6 +121,22 @@ TAO_IIOP_Acceptor::open (TAO_ORB_Core *orb_core,
orb_core->server_factory ()->scheduling_strategy ()) == -1)
return -1; // Failure
+ char tmp_host[MAXHOSTNAMELEN+1];
+ this->port_ = addr.get_port_number ();
+ if (orb_core->orb_params ()->use_dotted_decimal_addresses ())
+ {
+ const char *tmp;
+ if ((tmp = addr.get_host_addr ()) == 0)
+ return -1;
+ this->host_ = tmp;
+ }
+ else
+ {
+ if (addr.get_host_name (tmp_host, MAXHOSTNAMELEN + 1) != 0)
+ return -1;
+ this->host_ = tmp_host;
+ }
+
return 0; // Success
}
diff --git a/TAO/tao/IIOP_Acceptor.h b/TAO/tao/IIOP_Acceptor.h
index 43ea952e915..be13bd794bd 100644
--- a/TAO/tao/IIOP_Acceptor.h
+++ b/TAO/tao/IIOP_Acceptor.h
@@ -69,6 +69,15 @@ public:
private:
TAO_IIOP_BASE_ACCEPTOR base_acceptor_;
// the concrete acceptor, as a pointer to it's base class.
+
+ ACE_CString host_;
+ // the host name for this endpoint
+ // @@ there may in fact be multiple hostnames for this endpoint.
+ // @@ for example it the IP address is INADDR_ANY (0.0.0.0) then
+ // @@ there will be possibly a different hostname for each interface.
+
+ CORBA::UShort port_;
+ // port number for this host. This shouyld be non-zero.
};
#endif /* TAO_IIOP_ACCEPTOR_H */