| 1425 | |
| 1426 | |
| 1427 | class msg_ping: |
| 1428 | __slots__ = ("nonce",) |
| 1429 | msgtype = b"ping" |
| 1430 | |
| 1431 | def __init__(self, nonce=0): |
| 1432 | self.nonce = nonce |
| 1433 | |
| 1434 | def deserialize(self, f): |
| 1435 | self.nonce = int.from_bytes(f.read(8), "little") |
| 1436 | |
| 1437 | def serialize(self): |
| 1438 | r = b"" |
| 1439 | r += self.nonce.to_bytes(8, "little") |
| 1440 | return r |
| 1441 | |
| 1442 | def __repr__(self): |
| 1443 | return "msg_ping(nonce=%08x)" % self.nonce |
| 1444 | |
| 1445 | |
| 1446 | class msg_pong: |
no outgoing calls