Skip to content

Commit

Permalink
[ot] python/qemu: jtagtools.rbb: ensure TCP socket is configured with…
Browse files Browse the repository at this point in the history
… nodelay

Signed-off-by: Emmanuel Blot <[email protected]>
  • Loading branch information
rivos-eblot committed Dec 5, 2024
1 parent b23df94 commit 131c320
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/qemu/jtagtools/rbb/bitbang.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"""

from logging import getLogger
from socket import socket
from socket import socket, SOCK_STREAM, IPPROTO_TCP, TCP_NODELAY
from time import time as now
from typing import Optional

Expand Down Expand Up @@ -67,6 +67,9 @@ def __init__(self, sock: socket, link_log: bool = False):
self._tdi = False
self._trst = False
self._srst = False
if self._sock.proto == IPPROTO_TCP and self._sock.type == SOCK_STREAM:
self._sock.setsockopt(IPPROTO_TCP, TCP_NODELAY, 1)
self._sock.settimeout(self.RECV_TIMEOUT)

def tap_reset(self, use_trst: bool = False) -> None:
self._log.info('TAP reset (%s)', 'TRST' if use_trst else 'SW')
Expand Down

0 comments on commit 131c320

Please sign in to comment.