Public Member Functions | Protected Attributes

TAO_SFP_Producer_Object Class Reference

#include <sfp.h>

Inheritance diagram for TAO_SFP_Producer_Object:
Inheritance graph
[legend]
Collaboration diagram for TAO_SFP_Producer_Object:
Collaboration graph
[legend]

List of all members.

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_

Detailed Description

Definition at line 258 of file sfp.h.


Constructor & Destructor Documentation

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]);
    }
}


Member Function Documentation

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;
}


Member Data Documentation

Definition at line 266 of file sfp.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines