Will be called by sniff() to ask for a packet
(self, sock: 'SuperSocket')
| 408 | return None |
| 409 | |
| 410 | def recv(self, sock: 'SuperSocket') -> Iterator[Packet]: |
| 411 | """ |
| 412 | Will be called by sniff() to ask for a packet |
| 413 | """ |
| 414 | pkt = sock.recv(stop_dissection_after=self.stop_dissection_after) |
| 415 | # Now handle TCP reassembly |
| 416 | if self.app: |
| 417 | while pkt is not None: |
| 418 | pkt = self.process(pkt) |
| 419 | if pkt: |
| 420 | yield pkt |
| 421 | # keep calling process as there might be more |
| 422 | pkt = b"" # type: ignore |
| 423 | else: |
| 424 | pkt = self.process(pkt) # type: ignore |
| 425 | if pkt: |
| 426 | yield pkt |
| 427 | return None |