Sha256: 68d9d98a25c01f7aa79a973a01d75dbc3656b8db607d7f0dc8eb53fd22b3a079

Contents?: true

Size: 825 Bytes

Versions: 13

Compression:

Stored size: 825 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

13 entries across 11 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.5.7 lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/connectionData/WsConnectionData.py
javonet-ruby-sdk-2.5.6 lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/connectionData/WsConnectionData.py
javonet-ruby-sdk-2.5.5 lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/connectionData/WsConnectionData.py
javonet-ruby-sdk-2.5.4 lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/connectionData/WsConnectionData.py
javonet-ruby-sdk-2.5.3 lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/connectionData/WsConnectionData.py
javonet-ruby-sdk-2.5.2 lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/connectionData/WsConnectionData.py
javonet-ruby-sdk-2.5.1 lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/connectionData/WsConnectionData.py
javonet-ruby-sdk-2.5.0 lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/connectionData/WsConnectionData.py
javonet-ruby-sdk-2.4.11 lib/javonet-ruby-sdk/Binaries/Python/javonet/utils/connectionData/WsConnectionData.py
javonet-ruby-sdk-2.4.10 lib/javonet-ruby-sdk/Binaries/Python/MacOs/X64/javonet/utils/connectionData/WsConnectionData.py
javonet-ruby-sdk-2.4.10 lib/javonet-ruby-sdk/Binaries/Python/Linux/X64/javonet/utils/connectionData/WsConnectionData.py
javonet-ruby-sdk-2.4.9 lib/javonet-ruby-sdk/Binaries/Python/Linux/X64/javonet/utils/connectionData/WsConnectionData.py
javonet-ruby-sdk-2.4.9 lib/javonet-ruby-sdk/Binaries/Python/MacOs/X64/javonet/utils/connectionData/WsConnectionData.py