#include <UDP.h>
Inheritance diagram for TAO_AV_UDP_Acceptor:
Public Member Functions | |
TAO_AV_UDP_Acceptor (void) | |
virtual | ~TAO_AV_UDP_Acceptor (void) |
virtual int | open (TAO_Base_StreamEndPoint *endpoint, TAO_AV_Core *av_core, TAO_FlowSpec_Entry *entry, TAO_AV_Flow_Protocol_Factory *factory, TAO_AV_Core::Flow_Component flow_comp=TAO_AV_Core::TAO_AV_DATA) |
virtual int | open_default (TAO_Base_StreamEndPoint *endpoint, TAO_AV_Core *av_core, TAO_FlowSpec_Entry *entry, TAO_AV_Flow_Protocol_Factory *factory, TAO_AV_Core::Flow_Component flow_comp=TAO_AV_Core::TAO_AV_DATA) |
virtual int | open_i (ACE_INET_Addr *address, int is_default_open) |
virtual int | close (void) |
virtual int | activate_svc_handler (TAO_AV_Flow_Handler *handler) |
Protected Attributes | |
ACE_INET_Addr * | address_ |
ACE_INET_Addr * | control_inet_address_ |
TAO_Base_StreamEndPoint * | endpoint_ |
TAO_FlowSpec_Entry * | entry_ |
TAO_AV_Flow_Protocol_Factory * | flow_protocol_factory_ |
TAO_AV_Core::Flow_Component | flow_component_ |
|
Definition at line 325 of file UDP.cpp.
00326 : address_ (0), 00327 control_inet_address_ (0) 00328 { 00329 } |
|
Definition at line 331 of file UDP.cpp. References TAO_FlowSpec_Entry::control_handler(), control_inet_address_, and flow_component_.
00332 { 00333 if (this->flow_component_ == TAO_AV_Core::TAO_AV_CONTROL) 00334 delete this->entry_->control_handler (); 00335 00336 delete this->address_; 00337 delete this->control_inet_address_; 00338 } |
|
Definition at line 341 of file UDP.cpp. References TAO_AV_Flow_Handler::event_handler(), flow_component_, TAO_AV_Core::reactor(), and TAO_AV_Flow_Handler::schedule_timer(). Referenced by open_i().
00342 { 00343 ACE_Event_Handler *event_handler = handler->event_handler (); 00344 int result = this->av_core_->reactor ()->register_handler (event_handler, 00345 ACE_Event_Handler::READ_MASK); 00346 00347 if (this->flow_component_ == TAO_AV_Core::TAO_AV_CONTROL) 00348 handler->schedule_timer (); 00349 00350 return result; 00351 } |
|
Implements TAO_AV_Acceptor. Definition at line 559 of file UDP.cpp.
00560 {
00561 return 0;
00562 }
|
|
Implements TAO_AV_Acceptor. Definition at line 354 of file UDP.cpp. References ACE_DEBUG, flow_component_, TAO_AV_Core::get_control_flowname(), LM_DEBUG, open_i(), and TAO_debug_level.
00359 { 00360 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_Acceptor::open\n")); 00361 this->av_core_ = av_core; 00362 this->endpoint_ = endpoint; 00363 this->entry_ = entry; 00364 this->flow_component_ = flow_comp; 00365 this->flow_protocol_factory_ = factory; 00366 ACE_INET_Addr *inet_addr; 00367 if (flow_comp == TAO_AV_Core::TAO_AV_CONTROL) 00368 { 00369 this->flowname_ = TAO_AV_Core::get_control_flowname (entry->flowname ()); 00370 inet_addr = (ACE_INET_Addr *) entry->control_address (); 00371 } 00372 else 00373 { 00374 this->flowname_ = entry->flowname (); 00375 inet_addr = (ACE_INET_Addr *) entry->address (); 00376 } 00377 00378 if (inet_addr != 0) 00379 { 00380 char buf[BUFSIZ]; 00381 inet_addr->addr_to_string (buf, 00382 BUFSIZ); 00383 00384 if (TAO_debug_level > 0) 00385 ACE_DEBUG ((LM_DEBUG, 00386 "TAO_AV_UDP_Acceptor::open: %s\n", 00387 buf)); 00388 } 00389 00390 int result = this->open_i (inet_addr, 0); 00391 00392 if (result < 0) 00393 return result; 00394 return 0; 00395 } |
|
Implements TAO_AV_Acceptor. Definition at line 398 of file UDP.cpp. References ACE_NEW_RETURN, flow_component_, TAO_AV_Core::get_control_flowname(), and open_i().
00403 { 00404 this->av_core_ = av_core; 00405 this->endpoint_ = endpoint; 00406 this->entry_ = entry; 00407 this->flow_component_ = flow_comp; 00408 this->flow_protocol_factory_ = factory; 00409 if (flow_comp == TAO_AV_Core::TAO_AV_CONTROL) 00410 { 00411 this->flowname_ = TAO_AV_Core::get_control_flowname (entry->flowname ()); 00412 } 00413 else 00414 { 00415 this->flowname_ = entry->flowname (); 00416 ACE_NEW_RETURN (this->address_, 00417 ACE_INET_Addr ("0"), 00418 -1); 00419 } 00420 00421 int result = this->open_i (this->address_, 1); 00422 if (result < 0) 00423 return result; 00424 00425 return 0; 00426 } |
|
Definition at line 429 of file UDP.cpp. References ACE_DEBUG, ACE_NEW_RETURN, activate_svc_handler(), ACE_INET_Addr::addr_to_string(), TAO_FlowSpec_Entry::address(), TAO_FlowSpec_Entry::control_address(), TAO_FlowSpec_Entry::control_handler(), control_inet_address_, TAO_FlowSpec_Entry::control_protocol_object(), flow_component_, ACE_INET_Addr::get_host_name(), TAO_FlowSpec_Entry::get_local_control_addr(), ACE_INET_Addr::get_port_number(), TAO_FlowSpec_Entry::handler(), LM_DEBUG, TAO_AV_Flow_Protocol_Factory::make_protocol_object(), TAO_FlowSpec_Entry::protocol_object(), TAO_AV_Flow_Handler::protocol_object(), ACE_INET_Addr::set(), TAO_Base_StreamEndPoint::set_control_flow_handler(), TAO_Base_StreamEndPoint::set_flow_handler(), TAO_FlowSpec_Entry::set_local_addr(), TAO_FlowSpec_Entry::set_local_control_addr(), TAO_AV_UDP_Connection_Setup::setup(), ACE_OS::strcasecmp(), TAO_debug_level, and TAO_AV_Flow_Handler::transport(). Referenced by open(), and open_default().
00431 { 00432 int result = -1; 00433 ACE_INET_Addr *local_addr = 0; 00434 00435 TAO_AV_Flow_Handler *flow_handler = 0; 00436 00437 // if using a default address and this is the control flow component, the 00438 // handler and local address are already set in the flow spec entry 00439 if (is_default_addr && 00440 (this->flow_component_ == TAO_AV_Core::TAO_AV_CONTROL) && 00441 (ACE_OS::strcasecmp(this->entry_->flow_protocol_str (), "RTP") == 0)) 00442 { 00443 flow_handler = this->entry_->control_handler (); 00444 00445 local_addr = dynamic_cast<ACE_INET_Addr*> (this->entry_->get_local_control_addr ()); 00446 } 00447 else 00448 { 00449 // this variable is only used for RTP/UDP; RFC 1889 requires an even/odd 00450 // consecutive port pair 00451 int get_new_port = 1; 00452 00453 while (get_new_port) 00454 { 00455 // assume the ports will be OK 00456 get_new_port = 0; 00457 00458 result = TAO_AV_UDP_Connection_Setup::setup (flow_handler, 00459 inet_addr, 00460 local_addr, 00461 this->entry_->is_multicast (), 00462 TAO_AV_UDP_Connection_Setup::ACCEPTOR); 00463 00464 if (result < 0) 00465 { 00466 ACE_DEBUG((LM_DEBUG,"(%N,%l) Error during connection setup: %d\n", result)); 00467 } 00468 00469 local_addr->set (local_addr->get_port_number (), 00470 local_addr->get_host_name ()); 00471 00472 if (is_default_addr) 00473 { 00474 if ((ACE_OS::strcasecmp(this->entry_->flow_protocol_str (), "RTP") == 0) && 00475 (this->flow_component_ == TAO_AV_Core::TAO_AV_DATA)) 00476 { 00477 if (is_default_addr && local_addr->get_port_number ()%2 != 0) 00478 { 00479 // RTP port should be even 00480 delete local_addr; 00481 delete flow_handler; 00482 get_new_port = 1; 00483 } 00484 else 00485 { 00486 ACE_INET_Addr *local_control_addr; 00487 TAO_AV_Flow_Handler *control_flow_handler = 0; 00488 00489 ACE_NEW_RETURN (this->control_inet_address_, 00490 ACE_INET_Addr ("0"), 00491 -1); 00492 00493 TAO_AV_UDP_Connection_Setup::setup(control_flow_handler, 00494 this->control_inet_address_, 00495 local_control_addr, 00496 this->entry_->is_multicast (), 00497 TAO_AV_UDP_Connection_Setup::ACCEPTOR); 00498 00499 if (local_control_addr->get_port_number () != 00500 local_addr->get_port_number () +1) 00501 { 00502 delete this->control_inet_address_; 00503 delete local_addr; 00504 delete flow_handler; 00505 delete local_control_addr; 00506 delete control_flow_handler; 00507 get_new_port = 1; 00508 } 00509 else 00510 { 00511 this->entry_->control_address (this->control_inet_address_); 00512 this->entry_->set_local_control_addr (local_control_addr); 00513 this->entry_->control_handler (control_flow_handler); 00514 } 00515 } 00516 } 00517 } 00518 } 00519 } 00520 00521 TAO_AV_Protocol_Object *object = 00522 this->flow_protocol_factory_->make_protocol_object (this->entry_, 00523 this->endpoint_, 00524 flow_handler, 00525 flow_handler->transport ()); 00526 flow_handler->protocol_object (object); 00527 00528 if (this->flow_component_ == TAO_AV_Core::TAO_AV_DATA) 00529 { 00530 this->endpoint_->set_flow_handler (this->flowname_.c_str (),flow_handler); 00531 00532 this->entry_->protocol_object (object); 00533 this->entry_->set_local_addr (local_addr); 00534 this->entry_->handler (flow_handler); 00535 //this->entry_->address (inet_addr); 00536 this->entry_->address (local_addr); 00537 } 00538 else 00539 { 00540 this->endpoint_->set_control_flow_handler (this->flowname_.c_str (),flow_handler); 00541 00542 this->entry_->control_protocol_object (object); 00543 this->entry_->set_local_control_addr (local_addr); 00544 this->entry_->control_handler (flow_handler); 00545 } 00546 00547 char buf[BUFSIZ]; 00548 local_addr->addr_to_string (buf,BUFSIZ); 00549 if (TAO_debug_level > 0) 00550 ACE_DEBUG ((LM_DEBUG, 00551 "TAO_AV_UDP_ACCEPTOR::open:%s \n", 00552 buf)); 00553 00554 // call activate svc handler. 00555 return this->activate_svc_handler (flow_handler); 00556 } |
|
Reimplemented from TAO_AV_Acceptor. |
|
Definition at line 169 of file UDP.h. Referenced by open_i(), and ~TAO_AV_UDP_Acceptor(). |
|
|
|
|
|
Definition at line 173 of file UDP.h. Referenced by activate_svc_handler(), open(), open_default(), open_i(), and ~TAO_AV_UDP_Acceptor(). |
|
|