summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-04-02 20:20:44 +0000
committermk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-04-02 20:20:44 +0000
commit2707a9e28089fae3817af170e9179ef4820d445c (patch)
treea40952ded082bcf15bfbfbd78d0a8ee716235c3b
parent925a1aec55886df9ccfc051e4cb5fa99c802c98c (diff)
downloadATCD-2707a9e28089fae3817af170e9179ef4820d445c.tar.gz
ChangeLogTag: Mon Apr 2 15:20:00 2001 Michael Kircher <Michael.Kircher@mchp.siemens.de>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a16
-rw-r--r--TAO/examples/PluggableUDP/DIOP/DIOP_Acceptor.cpp153
-rw-r--r--TAO/examples/PluggableUDP/DIOP/DIOP_Acceptor.h14
-rw-r--r--TAO/examples/PluggableUDP/DIOP/DIOP_Connection_Handler.cpp10
-rw-r--r--TAO/examples/PluggableUDP/DIOP/DIOP_Connector.cpp372
-rw-r--r--TAO/examples/PluggableUDP/DIOP/DIOP_Connector.h7
-rw-r--r--TAO/examples/PluggableUDP/DIOP/DIOP_Transport.cpp49
-rw-r--r--TAO/examples/PluggableUDP/DIOP/DIOP_Transport.h2
8 files changed, 48 insertions, 575 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index cfb0243bb68..350336de03e 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,19 @@
+Mon Apr 2 15:20:00 2001 Michael Kircher <Michael.Kircher@mchp.siemens.de>
+
+ * examples/PluggableUDP/DIOP/DIOP_Transport.cpp:
+ * examples/PluggableUDP/DIOP/DIOP_Transport.h:
+ Removed the use of the local buffer as TAO now
+ supports the single read mechanism, which will
+ read in all of the UDP datagram.
+
+ * examples/PluggableUDP/DIOP/DIOP_Connection_Handler.cpp:
+ * examples/PluggableUDP/DIOP/DIOP_Connector.cpp:
+ * examples/PluggableUDP/DIOP/DIOP_Connector.h:
+ * examples/PluggableUDP/DIOP/DIOP_Acceptor.cpp:
+ * examples/PluggableUDP/DIOP/DIOP_Acceptor.h:
+ Removed dead code, e.g. we do not support
+ TCP properties, preconnects, and cached connections.
+
Mon Apr 2 15:09:23 2001 Chad Elliott <elliott_c@ociweb.com>
* tao/IFR_Client/IFR_ExtendedC.h:
diff --git a/TAO/examples/PluggableUDP/DIOP/DIOP_Acceptor.cpp b/TAO/examples/PluggableUDP/DIOP/DIOP_Acceptor.cpp
index e58a356a13d..f3e9d986165 100644
--- a/TAO/examples/PluggableUDP/DIOP/DIOP_Acceptor.cpp
+++ b/TAO/examples/PluggableUDP/DIOP/DIOP_Acceptor.cpp
@@ -19,32 +19,6 @@
ACE_RCSID(tao, DIOP_Acceptor, "$Id$")
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-
-template class ACE_Acceptor<TAO_DIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>;
-template class ACE_Strategy_Acceptor<TAO_DIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>;
-template class ACE_Accept_Strategy<TAO_DIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>;
-template class ACE_Creation_Strategy<TAO_DIOP_Connection_Handler>;
-template class ACE_Concurrency_Strategy<TAO_DIOP_Connection_Handler>;
-template class ACE_Scheduling_Strategy<TAO_DIOP_Connection_Handler>;
-template class TAO_Creation_Strategy<TAO_DIOP_Connection_Handler>;
-template class TAO_Concurrency_Strategy<TAO_DIOP_Connection_Handler>;
-template class TAO_Accept_Strategy<TAO_DIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>;
-
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-
-#pragma instantiate ACE_Acceptor<TAO_DIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>
-#pragma instantiate ACE_Strategy_Acceptor<TAO_DIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>
-#pragma instantiate ACE_Accept_Strategy<TAO_DIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>
-#pragma instantiate ACE_Creation_Strategy<TAO_DIOP_Connection_Handler>
-#pragma instantiate ACE_Concurrency_Strategy<TAO_DIOP_Connection_Handler>
-#pragma instantiate ACE_Scheduling_Strategy<TAO_DIOP_Connection_Handler>
-#pragma instantiate TAO_Creation_Strategy<TAO_DIOP_Connection_Handler>
-#pragma instantiate TAO_Concurrency_Strategy<TAO_DIOP_Connection_Handler>
-#pragma instantiate TAO_Accept_Strategy<TAO_DIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>
-
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
-
TAO_DIOP_Acceptor::TAO_DIOP_Acceptor (CORBA::Boolean flag)
: TAO_Acceptor (TAO_TAG_UDP_PROFILE),
addrs_ (0),
@@ -52,11 +26,7 @@ TAO_DIOP_Acceptor::TAO_DIOP_Acceptor (CORBA::Boolean flag)
endpoint_count_ (0),
version_ (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR),
orb_core_ (0),
- lite_flag_ (flag),
- base_acceptor_ (),
- creation_strategy_ (0),
- concurrency_strategy_ (0),
- accept_strategy_ (0)
+ lite_flag_ (flag)
{
}
@@ -66,10 +36,6 @@ TAO_DIOP_Acceptor::~TAO_DIOP_Acceptor (void)
// strategies.
this->close ();
- delete this->creation_strategy_;
- delete this->concurrency_strategy_;
- delete this->accept_strategy_;
-
delete [] this->addrs_;
for (size_t i = 0; i < this->endpoint_count_; ++i)
@@ -241,7 +207,8 @@ TAO_DIOP_Acceptor::is_collocated (const TAO_Endpoint *endpoint)
int
TAO_DIOP_Acceptor::close (void)
{
- return this->base_acceptor_.close ();
+ delete this->connection_handler_;
+ return 0;
}
int
@@ -407,20 +374,6 @@ TAO_DIOP_Acceptor::open_default (TAO_ORB_Core *orb_core,
int
TAO_DIOP_Acceptor::open_i (const ACE_INET_Addr& addr)
{
- ACE_NEW_RETURN (this->creation_strategy_,
- TAO_DIOP_CREATION_STRATEGY (this->orb_core_,
- &(this->tcp_properties_),
- this->lite_flag_),
- -1);
-
- ACE_NEW_RETURN (this->concurrency_strategy_,
- TAO_DIOP_CONCURRENCY_STRATEGY (this->orb_core_),
- -1);
-
- ACE_NEW_RETURN (this->accept_strategy_,
- TAO_DIOP_ACCEPT_STRATEGY (this->orb_core_),
- -1);
-
// @@ Michael: UDP changes ---------------
ACE_NEW_RETURN (this->connection_handler_,
@@ -432,44 +385,18 @@ TAO_DIOP_Acceptor::open_i (const ACE_INET_Addr& addr)
this->connection_handler_->local_addr (addr);
this->connection_handler_->open_server ();
+ /*
this->orb_core_->reactor ()->register_handler (this->connection_handler_,
- ACE_Event_Handler::READ_MASK);
-
+ ACE_Event_Handler::READ_MASK);
+ */
// ------------------------------------
- if (this->base_acceptor_.open (addr,
- this->orb_core_->reactor (this),
- this->creation_strategy_,
- this->accept_strategy_,
- this->concurrency_strategy_) == -1)
- {
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\n\nTAO (%P|%t) DIOP_Acceptor::open_i ")
- ACE_TEXT ("- %p\n\n"),
- ACE_TEXT ("cannot open acceptor")));
- return -1;
- }
-
- ACE_INET_Addr address;
- // We do this make sure the port number the endpoint is listening on
- // gets set in the addr.
- if (this->base_acceptor_.acceptor ().get_local_addr (address) != 0)
- {
- // @@ Should this be a catastrophic error???
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("\n\nTAO (%P|%t) DIOP_Acceptor::open_i ")
- ACE_TEXT ("- %p\n\n"),
- ACE_TEXT ("cannot get local addr")));
- return -1;
- }
// Set the port for each addr. If there is more than one network
// interface then the endpoint created on each interface will be on
// the same port. This is how a wildcard socket bind() is supposed
// to work.
- u_short port = address.get_port_number ();
+ u_short port = addr.get_port_number ();
for (size_t j = 0; j < this->endpoint_count_; ++j)
this->addrs_[j].set_port_number (port, 1);
@@ -805,70 +732,6 @@ TAO_DIOP_Acceptor::parse_options (const char *str)
int
TAO_DIOP_Acceptor::init_tcp_properties (void)
{
-#if (TAO_HAS_RT_CORBA == 1)
-
- // @@ Currently (in the code below), we obtain protocol properties from
- // ORB-level ServerProtocol, even though the policy may
- // have been overridden on POA level. That's because currently all
- // endpoints (acceptors) are global. Once endpoints become per POA,
- // the code below will have to be changed to look at the POA-level
- // ServerProtocol policy first.
-
- // @@ Later we may want to factor some of the code below
- // among different protocols and place it into TAO_Acceptor, for
- // example.
-
- // ServerProtocolProperties policy controls protocols configuration.
- // Look for protocol properties in the effective ServerProtocolPolicy.
-
- ACE_DECLARE_NEW_CORBA_ENV;
-
- int send_buffer_size = 0;
- int recv_buffer_size = 0;
- int no_delay = 0;
-
- TAO_Protocols_Hooks *tph = this->orb_core_->get_protocols_hooks ();
-
- if (tph != 0)
- {
- const char protocol [] = "diop";
- const char *protocol_type = protocol;
-
- int hook_return =
- tph->call_server_protocols_hook (this->orb_core_,
- send_buffer_size,
- recv_buffer_size,
- no_delay,
- protocol_type);
-
- if (hook_return == -1)
- return -1;
- }
-
- this->tcp_properties_.send_buffer_size =
- send_buffer_size;
- this->tcp_properties_.recv_buffer_size =
- recv_buffer_size;
- this->tcp_properties_.no_delay =
- no_delay;
-
- // @@ NOTE. RTCORBA treats a combination of transport+messaging
- // as a single protocol. Keep this in mind for when we adopt
- // RTCORBA approach to protocols configuration for nonRT use. In
- // particular, what are the semantics of independent variation of
- // messaging and transport layers, when one transport appears in
- // combination with several messaging protocols, for example.
-
-#else /* TAO_HAS_RT_CORBA == 1 */
-
- this->tcp_properties_.send_buffer_size =
- this->orb_core_->orb_params ()->sock_sndbuf_size ();
- this->tcp_properties_.recv_buffer_size =
- this->orb_core_->orb_params ()->sock_rcvbuf_size ();
- this->tcp_properties_.no_delay =
- this->orb_core_->orb_params ()->nodelay ();
-
-#endif /* TAO_HAS_RT_CORBA == 1 */
-
+ // @@ Michael: We use UDP, so we do not set TCP settings.
return 0;
}
diff --git a/TAO/examples/PluggableUDP/DIOP/DIOP_Acceptor.h b/TAO/examples/PluggableUDP/DIOP/DIOP_Acceptor.h
index 543fd07d925..a240f12df02 100644
--- a/TAO/examples/PluggableUDP/DIOP/DIOP_Acceptor.h
+++ b/TAO/examples/PluggableUDP/DIOP/DIOP_Acceptor.h
@@ -58,11 +58,6 @@ public:
/// Returns the array of endpoints in this acceptor
const ACE_INET_Addr *endpoints (void);
- typedef ACE_Strategy_Acceptor<TAO_DIOP_Connection_Handler, ACE_SOCK_ACCEPTOR> TAO_DIOP_BASE_ACCEPTOR;
- typedef TAO_Creation_Strategy<TAO_DIOP_Connection_Handler> TAO_DIOP_CREATION_STRATEGY;
- typedef TAO_Concurrency_Strategy<TAO_DIOP_Connection_Handler> TAO_DIOP_CONCURRENCY_STRATEGY;
- typedef TAO_Accept_Strategy<TAO_DIOP_Connection_Handler, ACE_SOCK_ACCEPTOR> TAO_DIOP_ACCEPT_STRATEGY;
-
/**
* The TAO_Acceptor methods, check the documentation in
* Pluggable.h for details.
@@ -175,15 +170,6 @@ protected:
CORBA::Boolean lite_flag_;
private:
-
- /// the concrete acceptor, as a pointer to it's base class.
- TAO_DIOP_BASE_ACCEPTOR base_acceptor_;
-
- /// Acceptor strategies.
- TAO_DIOP_CREATION_STRATEGY *creation_strategy_;
- TAO_DIOP_CONCURRENCY_STRATEGY *concurrency_strategy_;
- TAO_DIOP_ACCEPT_STRATEGY *accept_strategy_;
-
// @@ Frank: From DIOP_Acceptor.h
TAO_DIOP_Connection_Handler *connection_handler_;
diff --git a/TAO/examples/PluggableUDP/DIOP/DIOP_Connection_Handler.cpp b/TAO/examples/PluggableUDP/DIOP/DIOP_Connection_Handler.cpp
index 6026fe76dca..58afd5e8fb6 100644
--- a/TAO/examples/PluggableUDP/DIOP/DIOP_Connection_Handler.cpp
+++ b/TAO/examples/PluggableUDP/DIOP/DIOP_Connection_Handler.cpp
@@ -430,13 +430,9 @@ TAO_DIOP_Connection_Handler::handle_input_i (ACE_HANDLE,
if (--this->pending_upcalls_ <= 0)
result = -1;
- if (result == -1)
- return result;
- else if (result == 0)
- // Requires another call to handle_input ()
- return 1;
-
- return 0;
+ // We always return a positive number, as we do not have any
+ // send errors.
+ return 1;
}
// @@ Frank: From DIOP_Connect.cpp
diff --git a/TAO/examples/PluggableUDP/DIOP/DIOP_Connector.cpp b/TAO/examples/PluggableUDP/DIOP/DIOP_Connector.cpp
index 312c5dfcfb7..5e272a22aa7 100644
--- a/TAO/examples/PluggableUDP/DIOP/DIOP_Connector.cpp
+++ b/TAO/examples/PluggableUDP/DIOP/DIOP_Connector.cpp
@@ -18,9 +18,7 @@ ACE_RCSID(tao, DIOP_Connector, "$Id$")
TAO_DIOP_Connector::TAO_DIOP_Connector (CORBA::Boolean flag)
: TAO_Connector (TAO_TAG_UDP_PROFILE),
- lite_flag_ (flag),
- connect_strategy_ (),
- base_connector_ ()
+ lite_flag_ (flag)
{
}
@@ -33,41 +31,8 @@ TAO_DIOP_Connector::open (TAO_ORB_Core *orb_core)
{
this->orb_core (orb_core);
- // @@ Frank: No TCP properties or even DIOP properties yet.
-/*
- if (this->init_tcp_properties () != 0)
- return -1;
-*/
-
- // @@ Michael: For DIOP we should be able to get rid of the connection
- // caching.
-
- /*
-
- /// Our connect creation strategy
- TAO_DIOP_CONNECT_CREATION_STRATEGY *connect_creation_strategy = 0;
-
- ACE_NEW_RETURN (connect_creation_strategy,
- TAO_DIOP_CONNECT_CREATION_STRATEGY
- (orb_core->thr_mgr (),
- orb_core,
- &(this->tcp_properties_),
- this->lite_flag_),
- -1);
-
- /// Our activation strategy
- TAO_DIOP_CONNECT_CONCURRENCY_STRATEGY *concurrency_strategy = 0;
+ // @@ Michael: We do not use traditional connection management.
- ACE_NEW_RETURN (concurrency_strategy,
- TAO_DIOP_CONNECT_CONCURRENCY_STRATEGY (orb_core),
- -1);
-
- return this->base_connector_.open (this->orb_core ()->reactor (),
- connect_creation_strategy,
- &this->connect_strategy_,
- concurrency_strategy);
-
- */
return 0;
}
@@ -93,13 +58,7 @@ TAO_DIOP_Connector::close (void)
// -----------------------------------------------------------------
- // @@ Michael: For DIOP we should be able to get rid of the connection
- // caching.
- /*
- delete this->base_connector_.concurrency_strategy ();
- delete this->base_connector_.creation_strategy ();
- return this->base_connector_.close ();
- */
+ // @@ Michael: We do not use traditional connection management.
return 0;
}
@@ -140,9 +99,7 @@ TAO_DIOP_Connector::connect (TAO_Transport_Descriptor_Interface *desc,
return -1;
}
- // @@ Frank: int result = 0;
TAO_DIOP_Connection_Handler *svc_handler = 0;
- // @@ Frank: TAO_Connection_Handler *conn_handler = 0;
// @@ Michael -- UDP Additions ----------------------------
@@ -167,275 +124,31 @@ TAO_DIOP_Connector::connect (TAO_Transport_Descriptor_Interface *desc,
ACE_OS::memcpy (addr_str_i, addr_str, BUFSIZ);
svc_handler_table_.bind (addr_str_i,
svc_handler_i);
- // we increment the ref count to keep the handler from disappearing.
- // <decrement> should be called by the destructor of us.
-
svc_handler = svc_handler_i;
- }
- // @@ Frank svc_handler->increment ();
- if (TAO_debug_level > 2)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("(%P|%t) DIOP_Connector::connect - ")
- ACE_TEXT ("new connection on HANDLE %d\n"),
- svc_handler->peer ().get_handle ()));
-
- // ---------------------------------------------------------
-
-
-// @@ Michael: We shortcut the actual connector.
-/*
- // Check the Cache first for connections
- if (this->orb_core ()->connection_cache ().find_handler (desc,
- conn_handler) == 0)
- {
- // We have found a connection and a handler
- svc_handler =
- ACE_dynamic_cast (TAO_DIOP_Connection_Handler *,
- conn_handler);
- if (TAO_debug_level > 2)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("(%P|%t) DIOP_Connector::connect - ")
- ACE_TEXT ("got an existing connection on HANDLE %d\n"),
- svc_handler->peer ().get_handle ()));
- }
- else
- {
if (TAO_debug_level > 2)
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P|%t) DIOP_Connector::connect - ")
- ACE_TEXT ("making a new connection\n")));
-
- // @@ This needs to change in the next round when we implement a
- // policy that will not allow new connections when a connection
- // is busy.
- if (max_wait_time != 0)
- {
- ACE_Synch_Options synch_options (ACE_Synch_Options::USE_TIMEOUT,
- *max_wait_time);
-
- // We obtain the transport in the <svc_handler> variable. As
- // we know now that the connection is not available in Cache
- // we can make a new connection
- result = this->base_connector_.connect (svc_handler,
- remote_address,
- synch_options);
- }
- else
- {
- // We obtain the transport in the <svc_handler> variable. As
- // we know now that the connection is not available in Cache
- // we can make a new connection
- result = this->base_connector_.connect (svc_handler,
- remote_address);
- }
+ ACE_TEXT ("new connection on HANDLE %d\n"),
+ svc_handler->get_handle ()));
+ }
- if (result == -1)
- {
- // Give users a clue to the problem.
- if (TAO_debug_level)
- {
- ACE_DEBUG ((LM_ERROR,
- ACE_TEXT ("(%P|%t) %s:%u, connection to ")
- ACE_TEXT ("%s:%d failed (%p)\n"),
- __FILE__,
- __LINE__,
- diop_endpoint->host (),
- diop_endpoint->port (),
- ACE_TEXT ("errno")));
- }
- return -1;
- }
+ // @@ Frank svc_handler->increment ();
- if (TAO_debug_level > 2)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("(%P|%t) DIOP_Connector::connect - ")
- ACE_TEXT ("new connection on HANDLE %d\n"),
- svc_handler->peer ().get_handle ()));
+ // ---------------------------------------------------------
- // Add the handler to Cache
- int retval =
- this->orb_core ()->connection_cache ().cache_handler (desc,
- svc_handler);
+ // @@ Michael: We do not use traditional connection management.
- if (retval != 0 && TAO_debug_level > 0)
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("(%P|%t) DIOP_Connector::connect ")
- ACE_TEXT ("could not add the new connection to Cache \n")));
- }
- }
- */
+ transport = TAO_Transport::_duplicate (svc_handler->transport ());
- transport = svc_handler->transport ();
return 0;
}
int
-TAO_DIOP_Connector::preconnect (const char *preconnects)
+TAO_DIOP_Connector::preconnect (const char *)
{
- // Check for the proper protocol prefix.
- if (this->check_prefix (preconnects) != 0)
- return 0; // Failure: zero successful preconnections
-
- const char *protocol_removed =
- ACE_OS::strstr (preconnects,
- "://") + 3;
- // "+ 3" since strlen of "://" is 3.
-
- char *preconnections =
- ACE_OS::strdup (protocol_removed);
-
- int successes = 0;
- if (preconnections)
- {
- ACE_INET_Addr dest;
- ACE_Unbounded_Stack<ACE_INET_Addr> dests;
-
- size_t num_connections;
-
- char *nextptr = 0;
- char *where = 0;
- for (where = ACE::strsplit_r (preconnections, ",", nextptr);
- where != 0;
- where = ACE::strsplit_r (0, ",", nextptr))
- {
- int version_offset = 0;
- // Additional offset to remove version from preconnect, if it exists.
-
- if (isdigit (where[0]) &&
- where[1] == '.' &&
- isdigit (where[2]) &&
- where[3] == '@')
- version_offset = 4;
-
- // @@ For now, we just drop the version prefix. However, at
- // some point in the future the version may become useful.
-
- char *tport = 0;
- char *thost = where + version_offset;
- char *sep = ACE_OS::strchr (where, ':');
-
- if (sep)
- {
- *sep = '\0';
- tport = sep + 1;
-
- dest.set ((u_short) ACE_OS::atoi (tport), thost);
- dests.push (dest);
- }
- else
- {
- // No port was specified so assume that the port will be the
- // IANA assigned port for DIOP.
- //
- // DIOP: 683
- // DIOP over SSL: 684
-
- dest.set (683, thost);
- dests.push (dest);
-
- if (TAO_debug_level > 0)
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("TAO (%P|%t) No port specified for <%s>. ")
- ACE_TEXT ("Using <%d> as default port.\n"),
- where,
- dest.get_port_number ()));
- }
- }
- }
-
- // Create an array of addresses from the stack, as well as an
- // array of eventual handlers.
- num_connections = dests.size ();
- ACE_INET_Addr *remote_addrs = 0;
- TAO_DIOP_Connection_Handler **handlers = 0;
-
- ACE_NEW_RETURN (remote_addrs,
- ACE_INET_Addr[num_connections],
- -1);
-
- ACE_Auto_Basic_Array_Ptr<ACE_INET_Addr> safe_remote_addrs (remote_addrs);
-
- ACE_NEW_RETURN (handlers,
- TAO_DIOP_Connection_Handler *[num_connections],
- -1);
-
- ACE_Auto_Basic_Array_Ptr<TAO_DIOP_Connection_Handler*>
- safe_handlers (handlers);
-
- // No longer need to worry about exception safety at this point.
- remote_addrs = safe_remote_addrs.release ();
- handlers = safe_handlers.release ();
-
- size_t slot = 0;
-
- // Fill in the remote address array
- while (dests.pop (remote_addrs[slot]) == 0)
- handlers[slot++] = 0;
-
-
- // @@ Michael
-#if 0
- char *failures;
- ACE_NEW_RETURN (failures,
- char[num_connections],
- -1);
-
- // Finally, try to connect.
- this->base_connector_.connect_n (num_connections,
- handlers,
- remote_addrs,
- failures);
- // Loop over all the failures and set the handlers that
- // succeeded to idle state.
- for (slot = 0;
- slot < num_connections;
- slot++)
- {
- if (!failures[slot])
- {
- TAO_DIOP_Endpoint endpoint (remote_addrs[slot],
- 0);
- TAO_Base_Connection_Property prop (&endpoint);
-
- // Add the handler to Cache
- int retval =
- this->orb_core ()->connection_cache ().cache_handler (&prop,
- handlers[slot]);
- successes++;
-
- if (retval != 0 && TAO_debug_level > 4)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("TAO (%P|%t) Unable to add handles\n"),
- ACE_TEXT ("to cache \n")));
-
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("TAO (%P|%t) Preconnection <%s:%d> ")
- ACE_TEXT ("succeeded.\n"),
- remote_addrs[slot].get_host_name (),
- remote_addrs[slot].get_port_number ()));
- }
- else if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("TAO (%P|%t) Preconnection <%s:%d> failed.\n"),
- remote_addrs[slot].get_host_name (),
- remote_addrs[slot].get_port_number ()));
- }
-#endif /* 0 */
-
- ACE_OS::free (preconnections);
-
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("TAO (%P|%t) DIOP preconnections: %d successes and ")
- ACE_TEXT ("%d failures.\n"),
- successes,
- num_connections - successes));
- }
- return successes;
+ // @@ Michael: We do not support preconnects.
+ return 0;
}
TAO_Profile *
@@ -512,64 +225,7 @@ TAO_DIOP_Connector::object_key_delimiter (void) const
int
TAO_DIOP_Connector::init_tcp_properties (void)
{
-
-#if (TAO_HAS_RT_CORBA == 1)
-
- // Connector protocol properties are obtained from ORB-level
- // RTCORBA::ClientProtocolProperties policy override.
- // If the override doesn't exist or doesn't contain the
- // properties, we use ORB default.
- //
- // Currently, we do not use Object-level and Current-level policy
- // overrides for protocol configuration because connection
- // lookup and caching are not done based on protocol
- // properties.
-
- ACE_DECLARE_NEW_CORBA_ENV;
-
- int send_buffer_size = 0;
- int recv_buffer_size = 0;
- int no_delay = 0;
-
- TAO_Protocols_Hooks *tph = this->orb_core ()->get_protocols_hooks ();
-
- if (tph != 0)
- {
- const char protocol [] = "iiop";
- const char *protocol_type = protocol;
-
- int hook_result =
- tph->call_client_protocols_hook (this->orb_core (),
- send_buffer_size,
- recv_buffer_size,
- no_delay,
- protocol_type);
-
- if(hook_result == -1)
- return -1;
- }
-
- // Extract and locally store properties of interest.
- this->tcp_properties_.send_buffer_size =
- send_buffer_size;
- this->tcp_properties_.recv_buffer_size =
- recv_buffer_size;
- this->tcp_properties_.no_delay =
- no_delay;
-
-#else /* TAO_HAS_RT_CORBA == 1 */
-
- // Without RTCORBA, protocol configuration properties come from ORB
- // options.
- this->tcp_properties_.send_buffer_size =
- this->orb_core ()->orb_params ()->sock_sndbuf_size ();
- this->tcp_properties_.recv_buffer_size =
- this->orb_core ()->orb_params ()->sock_rcvbuf_size ();
- this->tcp_properties_.no_delay =
- this->orb_core ()->orb_params ()->nodelay ();
-
-#endif /* TAO_HAS_RT_CORBA == 1 */
-
+ // @@ Michael: We have not TCP, so we have no TCP properties.
return 0;
}
diff --git a/TAO/examples/PluggableUDP/DIOP/DIOP_Connector.h b/TAO/examples/PluggableUDP/DIOP/DIOP_Connector.h
index 160510b6fd3..7cdaa103c84 100644
--- a/TAO/examples/PluggableUDP/DIOP/DIOP_Connector.h
+++ b/TAO/examples/PluggableUDP/DIOP/DIOP_Connector.h
@@ -105,13 +105,6 @@ protected:
CORBA::Boolean lite_flag_;
private:
-
- /// Our connect strategy
- TAO_DIOP_CONNECT_STRATEGY connect_strategy_;
-
- /// The connector initiating connection requests for DIOP.
- TAO_DIOP_BASE_CONNECTOR base_connector_;
-
// @@ Michael: UDP Addition
ACE_Hash_Map_Manager_Ex < ACE_TCHAR *,
TAO_DIOP_Connection_Handler *,
diff --git a/TAO/examples/PluggableUDP/DIOP/DIOP_Transport.cpp b/TAO/examples/PluggableUDP/DIOP/DIOP_Transport.cpp
index e549ac38c4f..ff1d4e0778f 100644
--- a/TAO/examples/PluggableUDP/DIOP/DIOP_Transport.cpp
+++ b/TAO/examples/PluggableUDP/DIOP/DIOP_Transport.cpp
@@ -31,7 +31,6 @@ TAO_DIOP_Transport::TAO_DIOP_Transport (TAO_DIOP_Connection_Handler *handler,
orb_core)
, connection_handler_ (handler)
, messaging_object_ (0)
- , local_buffer_ (4192)
{
// @@ Michael: Here we hardcoded the size of the buffer!
if (flag)
@@ -156,49 +155,15 @@ TAO_DIOP_Transport::recv_i (char *buf,
{
ACE_INET_Addr from_addr;
- // We read always one datagram, the unread rest is buffered
- // if not immediately read.
- if (local_buffer_.length () == 0)
- {
- local_buffer_.crunch ();
- ssize_t n = this->connection_handler_->dgram ().recv (local_buffer_.wr_ptr (),
- local_buffer_.size (),
- from_addr);
-
- // Remember the from addr to eventually use it as remote
- // addr for the reply.
- this->connection_handler_->addr (from_addr);
+ ssize_t n = this->connection_handler_->dgram ().recv (buf,
+ len,
+ from_addr);
- if (n == -1)
- return -1;
- else
- local_buffer_.wr_ptr (n);
-
- ACE_DEBUG ((LM_DEBUG,
- "Received %d bytes from %s:%d\n",
- n,
- this->connection_handler_->addr ().get_host_name (),
- this->connection_handler_->addr ().get_port_number ()));
- }
-
- if (local_buffer_.length () > 0)
- {
- ssize_t to_read = -1;
- if (len >= local_buffer_.length ())
- to_read = local_buffer_.length ();
- else
- to_read = len;
-
- ACE_OS::memcpy (buf, local_buffer_.rd_ptr (), to_read);
- local_buffer_.rd_ptr (to_read);
-
- ACE_DEBUG ((LM_DEBUG,
- "Read %d bytes\n",
- to_read));
- return to_read;
- }
+ // Remember the from addr to eventually use it as remote
+ // addr for the reply.
+ this->connection_handler_->addr (from_addr);
- return -1;
+ return n;
}
diff --git a/TAO/examples/PluggableUDP/DIOP/DIOP_Transport.h b/TAO/examples/PluggableUDP/DIOP/DIOP_Transport.h
index c2f33f2f19e..58c6057b5f6 100644
--- a/TAO/examples/PluggableUDP/DIOP/DIOP_Transport.h
+++ b/TAO/examples/PluggableUDP/DIOP/DIOP_Transport.h
@@ -154,8 +154,6 @@ private:
/// Our messaging object.
TAO_Pluggable_Messaging *messaging_object_;
-
- ACE_Message_Block local_buffer_;
};
#if defined (__ACE_INLINE__)