Added NOP keepalive to telnet protocol. Resolves #641.

This commit is contained in:
Griatch 2015-03-06 16:53:24 +01:00
parent 0a57f3c9a9
commit 6dcc1b80b0

View file

@ -16,6 +16,7 @@ from evennia.server.portal.mccp import Mccp, mccp_compress, MCCP
from evennia.server.portal.mxp import Mxp, mxp_parse
from evennia.utils import utils, ansi, logger
IAC = chr(255)
NOP = chr(241)
_RE_N = re.compile(r"\{n$")
@ -64,7 +65,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
delay(2, callback=self.handshake_done, retval=True)
# set up a keep-alive
self.keep_alive = LoopingCall(self._write, NOP)
self.keep_alive = LoopingCall(self._write, IAC + NOP, now=False)
self.keep_alive.start(30)