| 1818 | |
| 1819 | |
| 1820 | class msg_ping: |
| 1821 | __slots__ = ("nonce",) |
| 1822 | msgtype = b"ping" |
| 1823 | |
| 1824 | def __init__(self, nonce=0): |
| 1825 | self.nonce = nonce |
| 1826 | |
| 1827 | def deserialize(self, f): |
| 1828 | self.nonce = struct.unpack("<Q", f.read(8))[0] |
| 1829 | |
| 1830 | def serialize(self): |
| 1831 | r = b"" |
| 1832 | r += struct.pack("<Q", self.nonce) |
| 1833 | return r |
| 1834 | |
| 1835 | def __repr__(self): |
| 1836 | return "msg_ping(nonce=%08x)" % self.nonce |
| 1837 | |
| 1838 | |
| 1839 | class msg_pong: |
no outgoing calls