def __init__(self): self.ready = False self.db = None self.db = MongoConn(MONGOIP, MONGOPORT) self.db._on('ready', self._dbready) self.db._on('close', self._dbclose) self.listener = listenplain(host=FBIP, port=FBPORT) self.listener._on('close', self._lclose) self.listener._on('connection', self._newconn) self.listener2 = listenplain(host=FBIP, port=FBPORT+1) self.listener2._on('close', self._lclose) self.listener2._on('connection', self._newconnplain) self.connections = set() self.subscribermap = collections.defaultdict(list) self.conn2chans = collections.defaultdict(list)
def __init__(self): self.ready = False self.db = None self.initdb() self.listener = listenplain(host=FBIP, port=FBPORT) self.listener._on('close', self._lclose) self.listener._on('connection', self._newconn) self.connections = set() self.subscribermap = collections.defaultdict(list) self.conn2chans = collections.defaultdict(list)
def __init__(self, host, port): EventGen.__init__(self) try: self.l = listenplain(host=host, port=port) except Exception, e: if e.errno == 13: info = "Permission denied. Run as root!" if e.errno == 98: info = "Port " + str(port) + " already bound. Stop running service on port " + str(port) + " first." else: info = "[ Errno " + str(e.errno) + "]", e.strerror logger.exception("Unable to bind socket: {0}".format(info)) sys.exit(1)
def __init__(self): EventGen.__init__(self) conf_parser = ConfigParser() conf_parser.read("glastopf.cfg") host = conf_parser.get("webserver", "host") port = conf_parser.getint("webserver", "port") try: self.l = listenplain(host=host, port=port) except Exception, e: print "\nUnable to bind socket:", if e.errno == 13: print "Permission denied. Run as root!\n" if e.errno == 98: print "Port " + str(port) + " already bound. Stop running service on port " + str(port) + " first.\n" else: print "[ Errno " + str(e.errno) + "]", e.strerror + "\n" sys.exit(1)
def __init__(self, port): EventGen.__init__(self) self.l = listenplain(host="0.0.0.0", port=port) self.l._on("connection", self.connection)
def __init__(self, ip='0.0.0.0', port=80): self.store = None self.listener = listenplain(host=ip, port=port) self.listener._on('close', self._lclose) self.listener._on('connection', self._newconn) self.connections = set()
def __init__(self): self.listener = listenplain(host=IP, port=PORT) self.listener._on('close', self._lclose) self.listener._on('connection', self._newconn)
def __init__(self, port): EventGen.__init__(self) self.l = listenplain(host='0.0.0.0', port=port) self.l._on('connection', self.connection)