Skip to content

Commit

Permalink
Merge pull request #2339 from spikefishjohn/patch-2
Browse files Browse the repository at this point in the history
Update telnet_server.py
  • Loading branch information
grossmj authored Jan 24, 2024
2 parents 85fd3ef + ac86717 commit 385fffe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gns3server/utils/asyncio/telnet_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ async def run(self, network_reader, network_writer):
sock = network_writer.get_extra_info("socket")
sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
# 60 sec keep alives, close tcp session after 4 missed
# Will keep a firewall from aging out telnet console.
writer_sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 60)
writer_sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 10)
writer_sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 4)
#log.debug("New connection from {}".format(sock.getpeername()))

# Keep track of connected clients
Expand Down

0 comments on commit 385fffe

Please sign in to comment.