MCPcopy Index your code
hub / github.com/secdev/scapy / SimpleSocket

Class SimpleSocket

scapy/supersocket.py:433–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431
432
433class SimpleSocket(SuperSocket):
434 desc = "wrapper around a classic socket"
435 __selectable_force_select__ = True
436
437 def __init__(self, sock, basecls=None):
438 # type: (socket.socket, Optional[Type[Packet]]) -> None
439 self.ins = sock
440 self.outs = sock
441 if basecls is None:
442 basecls = conf.raw_layer
443 self.basecls = basecls
444
445 def recv_raw(self, x=MTU):
446 # type: (int) -> Tuple[Optional[Type[Packet]], Optional[bytes], Optional[float]]
447 return self.basecls, self.ins.recv(x), None
448
449 if WINDOWS:
450 @staticmethod
451 def select(sockets, remain=None):
452 # type: (List[SuperSocket], Optional[float]) -> List[SuperSocket]
453 from scapy.automaton import select_objects
454 return select_objects(sockets, remain)
455
456
457class StreamSocket(SimpleSocket):

Callers 1

dclocatorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected