Skip to content

Commit

Permalink
(fix): fixed tcpip_keepalive for TCPIPSocketSession (#396) (#397)
Browse files Browse the repository at this point in the history
* (fix): fixed tcpip_keepalive for TCPIPSocketSession

* updated CHANGES.md to fix

* fixed mypy issues

---------

Co-authored-by: Oliver Petschick <o.petschick@senec.com>
  • Loading branch information
oliverpetschick and Oliver Petschick authored Oct 16, 2023
1 parent 79fd091 commit ea7fa43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ PyVISA-py Changelog
- fix missing sock.close() in rpc _connect()
- fix HiSLIP message tracking after read timeout PR #376
- handle read_termination of null in tcipip PR #394
- fix tcpip keepalive PR #396

0.7.0 (05/05/2023)
------------------
Expand Down
6 changes: 3 additions & 3 deletions pyvisa_py/tcpip.py
Original file line number Diff line number Diff line change
Expand Up @@ -1345,9 +1345,9 @@ def _set_tcpip_keepalive(
self.interface.setsockopt(
socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1 if attribute_state else 0
)
self.interface.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 60)
self.interface.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 60)
self.interface.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 5)
self.interface.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 60)
self.interface.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 60)
self.interface.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 5)
return StatusCode.success
return StatusCode.error_nonsupported_attribute

Expand Down

0 comments on commit ea7fa43

Please sign in to comment.