Esempio n. 1
0
	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)
Esempio n. 2
0
	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)
Esempio n. 3
0
    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)
Esempio n. 4
0
 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)
Esempio n. 5
0
 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)
Esempio n. 6
0
    def __init__(self, port):
        EventGen.__init__(self)

        self.l = listenplain(host="0.0.0.0", port=port)
        self.l._on("connection", self.connection)
Esempio n. 7
0
	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()
Esempio n. 8
0
 def __init__(self):
     self.listener = listenplain(host=IP, port=PORT)
     self.listener._on('close', self._lclose)
     self.listener._on('connection', self._newconn)
Esempio n. 9
0
 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()
Esempio n. 10
0
    def __init__(self, port):
        EventGen.__init__(self)

        self.l = listenplain(host='0.0.0.0', port=port)
        self.l._on('connection', self.connection)
Esempio n. 11
0
	def __init__(self):
		self.listener = listenplain(host=IP, port=PORT)
		self.listener._on('close', self._lclose)
		self.listener._on('connection', self._newconn)