14.3.3 Channel Class in C++

In C++, the class Channel extends the Connector object with several new methods to support a variety of MAC protocols. The class is defined as follow in ~ns/channel.h:

   class Channel : public Connector {
   public:
        Channel();
        void recv(Packet* p, Handler*);
        virtual int send(Packet* p, double txtime);
        virtual void contention(Packet*, Handler*);
        int hold(double txtime);
        virtual int collision() { return numtx_ \> 1; }
        virtual double txstop() { return txstop_; }
                . . .
   };

The important methods of the class Channel are:

Tom Henderson 2011-11-05