예제 #1
0
파일: xmpp.py 프로젝트: tanwanirahul/leela
 def on_core_connection_made(self):
     logger.warn("core_connection_made: %s" % self.key)
     mode = self.core.proc_match(self.query["regex"].encode("utf8"))
     proc = self.query["proc"].encode("utf8")
     self.core.send_proc(mode, proc)
     self.core.flush()
     self.xmpp.active[self.key] = self
예제 #2
0
파일: xmpp.py 프로젝트: tanwanirahul/leela
 def redis_pooling(self):
     data0 = yield self.redis.hgetall("leela.xmpp")
     for (key, conn) in list(self.active.iteritems()):
         if (key not in data0):
             logger.warn("reaping connection: %s" % (key,))
             conn.shutdown()
     for (key, data1) in data0.iteritems():
         data = parser.parse_json(data1)
         if (key not in self.active):
             logger.debug("spawning connection: %s: %s" % (key, data["sender"]))
             conn = Connection(key, xmppim.JID(data["sender"]), data["request"]["select"], self)
             self.core.connect(conn.factory())
예제 #3
0
 def relay(self, packet, sync=False):
     if (len(self.queue) < MAXQUEUE):
         self.queue.append(packet)
     else:
         logger.warn("discarding packet, queue full!!!")
     packet = "".join(self.queue[:25])
     flags = sync and 0 or socket.MSG_DONTWAIT
     try:
         self.fd.sendto(packet, flags, self.socket)
         del (self.queue[:25])
         self.packages += len(packet.split(";"))
     except socket.error:
         pass
예제 #4
0
파일: databus.py 프로젝트: deferraz/leela
 def relay(self, packet, sync=False):
     if (len(self.queue) < MAXQUEUE):
         self.queue.append(packet)
     else:
         logger.warn("discarding packet, queue full!!!")
     packet = "".join(self.queue[:25])
     flags  = sync and 0 or socket.MSG_DONTWAIT
     try:
         self.fd.sendto(packet, flags, self.socket)
         del(self.queue[:25])
         self.packages += len(packet.split(";"))
     except socket.error:
         pass
예제 #5
0
파일: udp_proto.py 프로젝트: deferraz/leela
 def datagramReceived(self, string, peer):
     try:
         if (string == "ping\n" or string == "ping"):
             self.handle_ping(peer)
         else:
             self.handle_event(string)
     except ValueError:
         if (logger.level <= logger.DEBUG):
             logger.exception()
     except Exception, e:
         logger.warn("error receiving packet [peer: %s, %s]" % (repr(peer), e))
         if (logger.level <= logger.DEBUG):
             logger.exception()
예제 #6
0
 def datagramReceived(self, string, peer):
     try:
         if (string == "ping\n" or string == "ping"):
             self.handle_ping(peer)
         else:
             self.handle_event(string)
     except ValueError:
         if (logger.level <= logger.DEBUG):
             logger.exception()
     except Exception, e:
         logger.warn("error receiving packet [peer: %s, %s]" %
                     (repr(peer), e))
         if (logger.level <= logger.DEBUG):
             logger.exception()
예제 #7
0
 def startService(self):
     service.Service.startService(self)
     logger.warn("starting cassandra service")
     self.dbus.attach("storage", self)
     self.storage.startService()
     self.loop.start(1)
예제 #8
0
파일: databus.py 프로젝트: deferraz/leela
 def startProtocol(self):
     logger.warn("starProtocol")
예제 #9
0
 def stopProtocol(self):
     logger.warn("stopProtocol")
예제 #10
0
파일: databus.py 프로젝트: deferraz/leela
 def connectionRefused(self):
     logger.warn("connectionRefused")
     reactor.callLater(1, self.connect)
예제 #11
0
파일: databus.py 프로젝트: deferraz/leela
 def stopProtocol(self):
     logger.warn("stopProtocol")
예제 #12
0
파일: storage.py 프로젝트: deferraz/leela
 def stopService(self):
     logger.warn("stoppping cassandra service")
     self.loop.stop()
     self.dbus.detach("storage")
     self.storage.stopService()
     service.Service.stopService(self)
예제 #13
0
파일: databus.py 프로젝트: deferraz/leela
 def connectionFailed(self, reason):
     logger.warn("connectionLost: %s" % reason.getErrorMessage())
     reactor.callLater(1, self.connect)
예제 #14
0
 def connectionRefused(self):
     logger.warn("connectionRefused")
     reactor.callLater(1, self.connect)
예제 #15
0
 def stopService(self):
     logger.warn("stoppping cassandra service")
     self.loop.stop()
     self.dbus.detach("storage")
     self.storage.stopService()
     service.Service.stopService(self)
예제 #16
0
파일: xmpp.py 프로젝트: tanwanirahul/leela
 def unsubscribeReceived(self, presence):
     logger.warn("unsubscription received: %s/%s" % (presence.sender, presence.recipient))
     self.unsubscribed(presence.sender)
     self.unsubscribe(presence.sender)
예제 #17
0
 def startProtocol(self):
     logger.warn("starProtocol")
예제 #18
0
파일: xmpp.py 프로젝트: tanwanirahul/leela
 def shutdown(self):
     logger.warn("disconnecting: %s" % self.key)
     self.core.send_close()
예제 #19
0
파일: storage.py 프로젝트: deferraz/leela
 def startService(self):
     service.Service.startService(self)
     logger.warn("starting cassandra service")
     self.dbus.attach("storage", self)
     self.storage.startService()
     self.loop.start(1)
예제 #20
0
 def connectionFailed(self, reason):
     logger.warn("connectionLost: %s" % reason.getErrorMessage())
     reactor.callLater(1, self.connect)