Sha256: 2815cde6846afe849d90cbf94c4679b7ed38eddf7e8621bdb35c92fe1e40b488
Contents?: true
Size: 855 Bytes
Versions: 2
Compression:
Stored size: 855 Bytes
Contents
import hashlib from javonet.utils.ConnectionType import ConnectionType from javonet.utils.connectionData.IConnectionData import IConnectionData class WsConnectionData(IConnectionData): def __init__(self, hostname: str): self._hostname = hostname @property def connection_type(self): return ConnectionType.WebSocket @property def hostname(self): return self._hostname def serialize_connection_data(self): return [self.connection_type.value, 0, 0, 0, 0, 0, 0] def __eq__(self, other): return isinstance(other, WsConnectionData) and self._hostname == other.hostname def __hash__(self): return int(hashlib.sha1(f"{self.hostname}".encode()).hexdigest(), 16) @hostname.setter def hostname(self, value): self._hostname = value
Version data entries
2 entries across 2 versions & 1 rubygems