From 798a412c6f8e81b1c07a88248d08f617aa1fb724 Mon Sep 17 00:00:00 2001 From: Steve Fan <19037626d@connect.polyu.hk> Date: Fri, 4 Feb 2022 13:51:19 +0800 Subject: [PATCH] comm_moninj: set keepalive for socket (#1843) --- artiq/coredevice/comm_moninj.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/artiq/coredevice/comm_moninj.py b/artiq/coredevice/comm_moninj.py index 392ad701a..f03e91bbc 100644 --- a/artiq/coredevice/comm_moninj.py +++ b/artiq/coredevice/comm_moninj.py @@ -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