On 10/9/06, Pedro Vale Estrela <[EMAIL PROTECTED]> wrote:
>
> Inside my recv() function I do like this without problems:
>
>
>         // clone the current packet and change some fields
>         Packet* new_p = clone_pkt(p);
>
>         hdr_ip    *new_iph      = hdr_ip::access(new_p);
>
>         new_iph->daddr() = ...;
>         new_iph->saddr() = addr();
>
>         // change fields on the current packet
>         iph->daddr() = id2iaddr(th->b_id);
>         iph->saddr() = addr();
>
>
>         // send original packet somewhere
>         send(p, 0);
>
>         // send cloned packet elsewhere
>         send(new_p, 0);
>
That doesn't seem to work for me when my class inherits from the queue class.

In my recv function I am doing:
while ((pkt = deque()) != NULL) {
        send(pkt,0);
}

I get this error:
Scheduler: attempt to schedule an event with a NULL handler.  Don't DO that.

If I change it to use the handler that is inherited from the queue class as
while ((pkt = deque()) != NULL) {
        send(pkt,&qh_);
}

I get an error like:
Scheduler: Event UID not valid!


If I only do process one packet each time recv is called but always
schedule() with a small
delay, I get NS time backwards error.

I need to schedule every 5-10ms even if no packets are arriving as the
object may have
held packets because of the queuing functions.

Reply via email to