run_twistd(["--help-reactors"])
sys.exit(1)
-DEFAULT_REACTOR = "select" if os.name == "nt" else "poll"
+try:
+ from select import epoll
+ DEFAULT_REACTOR = "epoll"
+except ImportError:
+ try:
+ from select import kqueue
+ DEFAULT_REACTOR = "kqueue"
+ except ImportError:
+ try:
+ from select import poll
+ DEFAULT_REACTOR = "poll"
+ except ImportError:
+ DEFAULT_REACTOR = "select"
parser = OptionParser()
parser.add_option("-n", "--no-daemon", help="Don't run in the background.", action="store_false", dest="daemonise", default=True)
parser.add_option("-H", "--certificate-chain", help="Path to SSL certificate chain file.", dest="sslchain")
parser.add_option("-P", "--pidfile", help="Path to store PID file", dest="pidfile")
parser.add_option("-s", "--syslog", help="Log to syslog", action="store_true", dest="syslog", default=False)
+parser.add_option("-f", "--flash-port", help="Port to listen for flash policy connections on.", type="int", dest="flashPort")
+parser.add_option("--profile", help="Run in profile mode, dumping results to this file", dest="profile")
+parser.add_option("--profiler", help="Name of profiler to use", dest="profiler")
parser.add_option("--syslog-prefix", help="Syslog prefix", dest="syslog_prefix", default="qwebirc")
sargs = sys.argv[1:]
args1+=["--pidfile", options.pidfile]
if options.syslog:
args1+=["--syslog"]
+if options.profile:
+ args1+=["--profile", options.profile]
+if options.profiler:
+ args1+=["--profiler", options.profiler]
+
if options.syslog and options.syslog_prefix:
import syslog
syslog.openlog(options.syslog_prefix)
if options.clogfile:
args2+=["--logfile", options.clogfile]
+if options.flashPort:
+ args2+=["--flashPort", options.flashPort]
+
if options.sslcertificate and options.sslkey:
args2+=["--certificate", options.sslcertificate, "--privkey", options.sslkey, "--https", options.port]
if options.sslchain: