示例#1
0
    def __init__(self, c, addr):
        EventGen.__init__(self)
        self.c, self.addr = c, addr

        self.c._on('ready', self.ready)
        self.c._on('close', self.closed)
        self.c._on('read', self.read)
示例#2
0
文件: evnetcatsrv.py 项目: rep/evnet
    def __init__(self, c, addr):
        EventGen.__init__(self)
        self.c, self.addr = c, addr

        self.c._on("ready", self.ready)
        self.c._on("close", self.closed)
        self.c._on("read", self.read)
示例#3
0
    def __init__(self, c, addr, glastopf):
        EventGen.__init__(self)
        self.glastopf_honeypot = glastopf
        self.c, self.addr = c, addr

        self.c._on('ready', self.ready)
        self.c._on('close', self.closed)
        self.c._on('read', self.read)
        self.c._on('allsent', self.close)
示例#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)
示例#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)
示例#6
0
文件: evnetcatsrv.py 项目: rep/evnet
    def __init__(self, port):
        EventGen.__init__(self)

        self.l = listenplain(host="0.0.0.0", port=port)
        self.l._on("connection", self.connection)
示例#7
0
    def __init__(self, port):
        EventGen.__init__(self)

        self.l = listenplain(host='0.0.0.0', port=port)
        self.l._on('connection', self.connection)