comm_moninj: set keepalive for socket (#1843)

This commit is contained in:
Steve Fan 2022-02-04 13:51:19 +08:00 committed by GitHub
parent e45cb217be
commit 798a412c6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@ import asyncio
import logging
import struct
from enum import Enum
from .comm import set_keepalive
__all__ = ["TTLProbe", "TTLOverride", "CommMonInj"]
@ -29,6 +29,8 @@ class CommMonInj:
async def connect(self, host, port=1383):
self._reader, self._writer = await asyncio.open_connection(host, port)
set_keepalive(self._writer.transport.get_extra_info('socket'), 1, 1, 3)
try:
self._writer.write(b"ARTIQ moninj\n")
# get device endian