Method: Capp#loop
- Defined in:
- ext/capp/capp.c
#loop {|packet| ... } ⇒ self #loop ⇒ Object
Starts capturing packets. Each packet captured is yielded to the block. Packets are instances of Capp::Packet.
If no block is given an enumerator is returned.
You can stop capturing packets by returning from the block (or using break) or by calling #stop on the instance. Packet capture can be restarted later.
892 893 894 895 896 897 898 899 900 |
# File 'ext/capp/capp.c', line 892 static VALUE capp_loop(VALUE self) { RETURN_ENUMERATOR(self, 0, 0); rb_ensure(capp_loop_run, self, capp_loop_end, self); return self; } |