#include <sfp.h>
Public Member Functions | |
TAO_SFP_Producer_Object (TAO_AV_Callback *callback, TAO_AV_Transport *transport, const char *flow_options) | |
virtual int | handle_input (void) |
Protected Attributes | |
CORBA::ULong | credit_sequence_num_ |
Definition at line 258 of file sfp.h.
TAO_SFP_Producer_Object::TAO_SFP_Producer_Object | ( | TAO_AV_Callback * | callback, | |
TAO_AV_Transport * | transport, | |||
const char * | flow_options | |||
) |
Definition at line 1162 of file sfp.cpp.
:TAO_SFP_Object (callback,transport), credit_sequence_num_ (0) { TAO_Tokenizer flow_string (sfp_options,':'); if (flow_string [2] != 0) { TAO_Tokenizer options (flow_string[2],'='); if (options [1] != 0) this->max_credit_ = ACE_OS::atoi (options[1]); } }
int TAO_SFP_Producer_Object::handle_input | ( | void | ) | [virtual] |
Implements TAO_SFP_Object.
Definition at line 1179 of file sfp.cpp.
{ // A producer can only receive credit messages. int result; flowProtocol::MsgType msg_type = flowProtocol::Start_Msg; result = TAO_SFP_Base::peek_message_type (this->transport_, msg_type); if (result < 0) return result; switch (msg_type) { case flowProtocol::Credit_Msg: { flowProtocol::credit credit; result = TAO_SFP_Base::read_credit_message (this->transport_, credit, this->state_.cdr); if (result < 0) return result; if (!this->credit_sequence_num_) this->credit_sequence_num_ = credit.cred_num; else { // check that the sequence number is above the last sequence number // else its a duplicate credit message so we can ignore it. if (credit.cred_num <= this->credit_sequence_num_) return 0; else // Update our credit now. this->current_credit_ = this->max_credit_; } } break; default: { ACE_Message_Block mb (2*this->transport_->mtu ()); // Ignore the rest of the message by just reading. this->transport_->recv (mb.rd_ptr (), mb.size ()); break; } } return 0; }