Add --run-once and --timeout TIME parameters.

- --run-once will exit after handling a single WebSocket connection
  (but not ater flash policy or normal web requests).

- --timeout TIME will stop listening for new connections after exit
  after TIME seconds (the master process shuts down). Existing
  WebSocket connections will continue but once all connections are
  closed all processes will terminate.
This commit is contained in:
Joel Martin
2011-09-22 15:52:02 -05:00
parent 1c39c7f1f0
commit 636aba62ed
2 changed files with 26 additions and 2 deletions
+4
View File
@@ -226,6 +226,10 @@ if __name__ == '__main__':
parser.add_option("--daemon", "-D",
dest="daemon", action="store_true",
help="become a daemon (background process)")
parser.add_option("--run-once", action="store_true",
help="handle a single WebSocket connection and exit")
parser.add_option("--timeout", type=int, default=0,
help="after TIMEOUT seconds exit when not connected")
parser.add_option("--cert", default="self.pem",
help="SSL certificate file")
parser.add_option("--key", default=None,