#include <UDP.h>
Inheritance diagram for TAO_AV_UDP_Flow_Handler:


Public Member Functions | |
| TAO_AV_UDP_Flow_Handler (void) | |
| virtual | ~TAO_AV_UDP_Flow_Handler (void) |
| int | open (ACE_Addr &address) |
| int | close (void) |
| virtual TAO_AV_Transport * | transport (void) |
| get the transport. | |
| virtual int | set_remote_address (ACE_Addr *address) |
| set the remote address. | |
| virtual ACE_HANDLE | get_handle (void) const |
| virtual int | handle_input (ACE_HANDLE fd) |
| virtual int | handle_timeout (const ACE_Time_Value &tv, const void *arg=0) |
| const ACE_SOCK_Dgram * | get_socket (void) const |
| virtual ACE_Event_Handler * | event_handler (void) |
| get the underlying event handler. To be overridden by the derived clases. | |
| virtual int | change_qos (AVStreams::QoS) |
| Change the QoS. | |
Protected Attributes | |
| TAO_AV_Core * | av_core_ |
| ACE_INET_Addr | peer_addr_ |
| ACE_SOCK_Dgram | sock_dgram_ |
Definition at line 110 of file UDP.h.
|
|
Ctor Dtor Definition at line 24 of file UDP.cpp. References ACE_NEW.
00025 {
00026 ACE_NEW (this->transport_,
00027 TAO_AV_UDP_Transport (this));
00028 }
|
|
|
Definition at line 30 of file UDP.cpp. References close(), and ACE_Singleton< TYPE, ACE_LOCK >::instance().
00031 {
00032 // remove the event handler from the reactor.
00033 TAO_AV_CORE::instance()->reactor ()->remove_handler (this->event_handler(),
00034 ACE_Event_Handler::READ_MASK);
00035
00036 // close the socket.
00037 this->close ();
00038 delete this->transport_;
00039 }
|
|
|
Change the QoS.
Reimplemented from TAO_AV_Flow_Handler. Definition at line 86 of file UDP.cpp. References ACE_DEBUG, IPPROTO_IP, LM_DEBUG, AVStreams::QoS::QoSParams, ACE_SOCK::set_option(), sock_dgram_, ACE_OS::strcmp(), and TAO_debug_level.
00087 {
00088 if( TAO_debug_level > 0 )
00089 {
00090 ACE_DEBUG ((LM_DEBUG,
00091 "(%N,%l) TAO_AV_UDP_Flow_Handler::change_qos\n"));
00092 }
00093
00094 unsigned int i=0;
00095
00096 int ret = 0;
00097 CORBA::Long dscp = 0;
00098 CORBA::Long ecn = 0;
00099 int dscp_flag=0;
00100 for(i=0; i < qos.QoSParams.length(); i++)
00101 {
00102
00103 if( ACE_OS::strcmp( qos.QoSParams[i].property_name.in(), "Diffserv_Codepoint") == 0)
00104 {
00105 qos.QoSParams[i].property_value >>= dscp;
00106 dscp_flag=1;
00107 // DSCP value can only be 6 bits wide
00108 if(!((dscp >= 0) && (dscp <= 63)))
00109 {
00110 dscp_flag = 0;
00111 ACE_DEBUG((LM_DEBUG, "(%N,%l) ECN value can only be (0-3) not %d\n", ecn));
00112 return -1;
00113 }
00114 }
00115
00116 if( ACE_OS::strcmp( qos.QoSParams[i].property_name.in(), "ECN") == 0)
00117 {
00118 qos.QoSParams[i].property_value >>= ecn;
00119 // ECN value can only occupy bits 6 and 7 of the
00120 // IP Diffserv byte
00121 if(!((ecn >= 0) && (ecn <= 3)))
00122 {
00123 ACE_DEBUG((LM_DEBUG, "(%N,%l) ECN value can only be (0-3) not %d\n", ecn));
00124 ecn = 0;
00125 }
00126
00127 }
00128 }
00129 // Set the Diffserv byte only if we specified
00130 // the Diffserv Codepoint (DSCP) or ECN via QoSParams
00131 // passed into this method
00132 if(dscp_flag || ecn)
00133 {
00134 int tos;
00135 tos = (int)(dscp << 2);
00136 if(ecn)
00137 {
00138 tos |= ecn;
00139 }
00140 ret = sock_dgram_.set_option(IPPROTO_IP, IP_TOS, (int *)&tos , (int)sizeof(tos));
00141
00142 if(TAO_debug_level > 1)
00143 {
00144 ACE_DEBUG((LM_DEBUG, "(%N,%l) set tos: ret: %d\n", ret));
00145 }
00146 }
00147
00148 if(TAO_debug_level > 1)
00149 {
00150 if(ret < 0 )
00151 {
00152 ACE_DEBUG((LM_DEBUG, "(%N,%l) errno: %p\n"));
00153 }
00154 }
00155 return ret;
00156 }
|
|
|
Definition at line 27 of file UDP.inl. References ACE_SOCK::close(), and sock_dgram_. Referenced by ~TAO_AV_UDP_Flow_Handler().
00028 {
00029 return this->sock_dgram_.close ();
00030 }
|
|
|
get the underlying event handler. To be overridden by the derived clases.
Implements TAO_AV_Flow_Handler. Definition at line 127 of file UDP.h.
00127 { return this; }
|
|
|
Reimplemented from ACE_Event_Handler. Definition at line 75 of file UDP.cpp. References ACE_DEBUG, ACE_IPC_SAP::get_handle(), LM_DEBUG, sock_dgram_, and TAO_debug_level.
00076 {
00077 if (TAO_debug_level > 0)
00078 ACE_DEBUG ((LM_DEBUG,
00079 "TAO_AV_UDP_Flow_Handler::get_handle:%d\n",
00080 this->sock_dgram_.get_handle ()));
00081
00082 return this->sock_dgram_.get_handle () ;
00083 }
|
|
|
Definition at line 13 of file UDP.inl. References sock_dgram_. Referenced by TAO_AV_UDP_Transport::recv(), and TAO_AV_UDP_Transport::send().
00014 {
00015 return &this->sock_dgram_;
00016 }
|
|
|
Reimplemented from ACE_Event_Handler. Definition at line 48 of file UDP.cpp. References TAO_AV_Protocol_Object::handle_input().
00049 {
00050 return this->protocol_object_->handle_input ();
00051 }
|
|
||||||||||||
|
Reimplemented from ACE_Event_Handler. Definition at line 54 of file UDP.cpp. References TAO_AV_Flow_Handler::handle_timeout().
00056 {
00057 return TAO_AV_Flow_Handler::handle_timeout (tv,arg);
00058 }
|
|
|
Definition at line 20 of file UDP.inl. References ACE_SOCK_Dgram::open(), and sock_dgram_. Referenced by TAO_AV_UDP_Connection_Setup::setup().
00021 {
00022 return this->sock_dgram_.open (address);
00023 }
|
|
|
set the remote address.
Reimplemented from TAO_AV_Flow_Handler. Definition at line 61 of file UDP.cpp. References ACE_DEBUG, LM_DEBUG, TAO_AV_UDP_Transport::set_remote_address(), and TAO_debug_level.
00062 {
00063 if (TAO_debug_level > 0)
00064 ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_Flow_Handler::set_remote_address\n"));
00065
00066 ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr*> (address);
00067 this->peer_addr_ = *inet_addr;
00068 TAO_AV_UDP_Transport *transport = dynamic_cast<TAO_AV_UDP_Transport*> (this->transport_);
00069
00070 return transport->set_remote_address (*inet_addr);
00071 }
|
|
|
get the transport.
Reimplemented from TAO_AV_Flow_Handler. Definition at line 42 of file UDP.cpp.
00043 {
00044 return this->transport_;
00045 }
|
|
|
|
|
|
|
|
|
Definition at line 134 of file UDP.h. Referenced by change_qos(), close(), get_handle(), get_socket(), and open(). |
1.3.6