On Fri, 2010-07-23 at 17:34 +0000, Panos Μatzakos wrote: 
> Hello and thanks for the answer. Well, now i know better what i need to do 
> and i am not sure if handlers is what i need. I try to implement a mac 
> protocol (802.11 csma/ca) and i am using the following flowgraph:
> 
> Timedsource -> Queue -> mysocket -> Discard 
> 
> where mysocket is the main element of my router which implements the 
> algorithm of the protocol and sends packets to PHY through sockets. So, i 
> want to be able to view from inside of mysocket when the Queue gets empty. Is 
> there a way to do that?                 
>                                                                               
>                        Thank you
> 

I assume mysocket is pull->pull !? 

Then you will call something like

mysocket::pull() { 
  Packet * p = input(0).pull(); 

} 
p is NULL exactly if Queue is empty. 

Further reading:
The Notifier class, especially Notifier::upstream_empty_signal

Harald





_______________________________________________
click mailing list
[email protected]
https://amsterdam.lcs.mit.edu/mailman/listinfo/click

Reply via email to