Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pyrisco/local/risco_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def __init__(self, host, port, code, **kwargs):
self._code = code
self._encoding = kwargs.get('encoding', 'utf-8')
self._max_concurrency = kwargs.get('concurrency', 4)
self._communication_delay = kwargs.get('communication_delay', 0)
self._reader = None
self._writer = None
self._crypt = None
Expand All @@ -28,8 +29,9 @@ async def connect(self):
self._cmd_id = 0
try:
self._semaphore = asyncio.Semaphore(self._max_concurrency)
self._futures = [None for i in range(MIN_CMD_ID,MIN_CMD_ID + MAX_CMD_ID)]
self._futures = [None for i in range(MIN_CMD_ID, MIN_CMD_ID + MAX_CMD_ID)]
self._reader, self._writer = await asyncio.open_connection(self._host, self._port)
await asyncio.sleep(self._communication_delay)
Comment thread
FredericMa marked this conversation as resolved.
Outdated
self._queue = asyncio.Queue()
self._listen_task = asyncio.create_task(self._listen())
self._crypt = RiscoCrypt(self._encoding)
Expand Down