MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / datagramReceived

Method datagramReceived

pager_lib/nmb/NetBIOSProtocol.py:31–41  ·  view source on GitHub ↗
(self, data, from_info)

Source from the content-addressed store, hash-verified

29 reactor.callLater(1, self.cleanupPendingTrns)
30
31 def datagramReceived(self, data, from_info):
32 host, port = from_info
33 trn_id, ret = self.decodePacket(data)
34
35 # pending transaction exists for trn_id - handle it and remove from queue
36 if trn_id in self.pending_trns:
37 _, ip, d = self.pending_trns.pop(trn_id)
38 if ip is NAME_QUERY:
39 # decode as query packet
40 trn_id, ret = self.decodeIPQueryPacket(data)
41 d.callback(ret)
42
43 def write(self, data, ip, port):
44 # We don't use the transport.write method directly as it keeps raising DeprecationWarning for ip='<broadcast>'

Callers

nothing calls this directly

Calls 4

decodePacketMethod · 0.80
popMethod · 0.80
decodeIPQueryPacketMethod · 0.80
callbackMethod · 0.80

Tested by

no test coverage detected