MCPcopy
hub / github.com/secdev/scapy / stop

Method stop

scapy/sendrecv.py:1405–1424  ·  view source on GitHub ↗

Stops AsyncSniffer if not in async mode

(self, join=True)

Source from the content-addressed store, hash-verified

1403 self.thread.start()
1404
1405 def stop(self, join=True):
1406 # type: (bool) -> Optional[PacketList]
1407 """Stops AsyncSniffer if not in async mode"""
1408 if self.running:
1409 self.stop_cb()
1410 if not hasattr(self, "continue_sniff"):
1411 # Never started -> is there an exception?
1412 if self.exception is not None:
1413 raise self.exception
1414 return None
1415 if self.continue_sniff:
1416 raise Scapy_Exception(
1417 "Unsupported (offline or unsupported socket)"
1418 )
1419 if join:
1420 self.join()
1421 return self.results
1422 return None
1423 else:
1424 raise Scapy_Exception("Not running ! (check .running attr)")
1425
1426 def join(self, *args, **kwargs):
1427 # type: (*Any, **Any) -> None

Callers 4

sniffMethod · 0.95
__init__Method · 0.45
_stop_sniffer_if_doneMethod · 0.45
_sndrcv_sndMethod · 0.45

Calls 3

stop_cbMethod · 0.95
joinMethod · 0.95
Scapy_ExceptionClass · 0.90

Tested by

no test coverage detected