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);
...
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Larry Brigman
> Sent: segunda-feira, 9 de Outubro de 2006 19:14
> To: [email protected]
> Subject: [ns] sending packets
>
>
> I am working on a queuing model. There are times that I need to
> send more than one packet in the recv function.
>
> Because of the way NS models things it looks like after a single send or
> target->recv(p,h) I cannot send again without an error.
>
> Is there a way to write a recv function that is allowed to send more than
> once?
>
> Also when I am rescheduling my class to deque packets, about the time I
> need to
> deque two or more packets NS detects that time has gone backwards!
>
>
> I am running this on FC4 using 2.29 version of NS.
>
> Thanks for any help provided.
> Larry