mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-05-26 07:08:08 +00:00
Send ping packets to keep connection alive
Fix #126 Idle WebSocket connections tend to be closed after some period of time. This commit enables the Butterfly server to send ping packets periodically in order to keep the connection alive. A new option `keepalive_interval` is also introduced for users to specify the interval to send `ping` packets. By default it is 30 seconds.
This commit is contained in:
@@ -40,6 +40,8 @@ tornado.options.define("unminified", default=False,
|
||||
|
||||
tornado.options.define("host", default='localhost', help="Server host")
|
||||
tornado.options.define("port", default=57575, type=int, help="Server port")
|
||||
tornado.options.define("keepalive_interval", default=30, type=int,
|
||||
help="Interval between ping packets sent from server to client (in seconds)")
|
||||
tornado.options.define("one_shot", default=False,
|
||||
help="Run a one-shot instance. Quit at term close")
|
||||
tornado.options.define("shell", help="Shell to execute at login")
|
||||
|
||||
Reference in New Issue
Block a user