/* -*- C++ -*- */
// ECG_UDP_Sender.inl,v 1.4 2003/11/04 05:21:32 dhinton Exp

#include "ace/Null_Mutex.h"

ACE_INLINE TAO_EC_Servant_Var<TAO_ECG_UDP_Sender>
TAO_ECG_UDP_Sender::create (CORBA::Boolean crc)
{
  TAO_EC_Servant_Var<TAO_ECG_UDP_Sender> s;
  ACE_NEW_RETURN (s,
                  TAO_ECG_UDP_Sender (crc),
                  s);
  return s;
}

ACE_INLINE
TAO_ECG_UDP_Sender::TAO_ECG_UDP_Sender (CORBA::Boolean crc)
  : supplier_proxy_ ()
  , lcl_ec_ ()
  , addr_server_ ()
  , cdr_sender_ (crc)
  , auto_proxy_disconnect_ ()
{
}

ACE_INLINE CORBA::ULong
TAO_ECG_UDP_Sender::mtu (void) const
{
  return this->cdr_sender_.mtu ();
}

ACE_INLINE int
TAO_ECG_UDP_Sender::mtu (CORBA::ULong new_mtu)
{
  return this->cdr_sender_.mtu (new_mtu);
}

ACE_INLINE int
TAO_ECG_UDP_Sender::get_local_addr (ACE_INET_Addr& addr)
{
  return this->cdr_sender_.get_local_addr (addr);
}
//***************************************************************************

ACE_INLINE
TAO_ECG_UDP_Sender_Disconnect_Command::
TAO_ECG_UDP_Sender_Disconnect_Command (void)
  : proxy_ ()
{
}

ACE_INLINE
TAO_ECG_UDP_Sender_Disconnect_Command::
TAO_ECG_UDP_Sender_Disconnect_Command (
                          RtecEventChannelAdmin::ProxyPushSupplier_ptr proxy)
  : proxy_ (RtecEventChannelAdmin::ProxyPushSupplier::_duplicate (proxy))
{
}

ACE_INLINE
TAO_ECG_UDP_Sender_Disconnect_Command::
TAO_ECG_UDP_Sender_Disconnect_Command (
                              const TAO_ECG_UDP_Sender_Disconnect_Command & rhs)
  : proxy_ (RtecEventChannelAdmin::ProxyPushSupplier::_duplicate
            (rhs.proxy_.in ()))
{
}

ACE_INLINE TAO_ECG_UDP_Sender_Disconnect_Command &
TAO_ECG_UDP_Sender_Disconnect_Command::operator= (
                             const TAO_ECG_UDP_Sender_Disconnect_Command & rhs)
{
  this->proxy_ =
    RtecEventChannelAdmin::ProxyPushSupplier::_duplicate (rhs.proxy_.in ());

  return *this;
}

ACE_INLINE void
TAO_ECG_UDP_Sender_Disconnect_Command::execute (ACE_ENV_SINGLE_ARG_DECL)
{
  if (CORBA::is_nil (this->proxy_.in ()))
    // We are not connected.
    return;

  RtecEventChannelAdmin::ProxyPushSupplier_var release_proxy =
    this->proxy_._retn ();

  release_proxy->disconnect_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
  ACE_CHECK;
}
