summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Event/ECG_UDP_Receiver.i
blob: 3f6a64bb48ccb36a288f17c03e5d0e6e35e64078 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// $Id$

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

ACE_INLINE
TAO_ECG_UDP_Receiver_Disconnect_Command::
TAO_ECG_UDP_Receiver_Disconnect_Command (
                          RtecEventChannelAdmin::ProxyPushConsumer_ptr proxy)
  : proxy_ (RtecEventChannelAdmin::ProxyPushConsumer::_duplicate (proxy))
{
}

ACE_INLINE
TAO_ECG_UDP_Receiver_Disconnect_Command::
TAO_ECG_UDP_Receiver_Disconnect_Command (
                          const TAO_ECG_UDP_Receiver_Disconnect_Command & rhs)
  : proxy_ (RtecEventChannelAdmin::ProxyPushConsumer::_duplicate
            (rhs.proxy_.in ()))
{
}

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

  return *this;
}

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

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

  release_proxy->disconnect_push_consumer (ACE_ENV_SINGLE_ARG_PARAMETER);
  ACE_CHECK;
}

//***************************************************************************

ACE_INLINE
TAO_ECG_UDP_Receiver::TAO_ECG_UDP_Receiver (CORBA::Boolean perform_crc)
  : lcl_ec_ ()
  , addr_server_ ()
  , consumer_proxy_ ()
  , cdr_receiver_ (perform_crc)
  , handler_rptr_ ()
  , auto_proxy_disconnect_ ()
{
}

ACE_INLINE TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver>
TAO_ECG_UDP_Receiver::create (CORBA::Boolean perform_crc)
{
  TAO_EC_Servant_Var<TAO_ECG_UDP_Receiver> r;
  ACE_NEW_RETURN (r,
                  TAO_ECG_UDP_Receiver (perform_crc),
                  r);
  return r;
}

ACE_INLINE void
TAO_ECG_UDP_Receiver::set_handler_shutdown (
                       TAO_ECG_Refcounted_Handler handler_shutdown_rptr)
{
  this->handler_rptr_ = handler_shutdown_rptr;
}

ACE_INLINE void
TAO_ECG_UDP_Receiver::get_addr (const RtecEventComm::EventHeader& header,
                                RtecUDPAdmin::UDP_Addr_out addr
                                ACE_ENV_ARG_DECL)
{
  if (CORBA::is_nil (this->addr_server_.in ()))
    {
      ACE_ERROR ((LM_ERROR,
                  "TAO_ECG_UDP_Receiver::get_addr() called but "
                  "nil Address Server was supplied during "
                  "initialization through init()."));

      ACE_THROW (CORBA::INTERNAL ());
    }

  this->addr_server_->get_addr (header, addr
                                ACE_ENV_ARG_PARAMETER);
}