Example #1
0
File: json.py Project: yapkke/yapc
 def receive(self, sock, recvthread):
     """Receive new connection
     """
     client, address = sock.accept()
     if not comm.BLOCKING:
         client.setblocking(0)
     recvthread.addconnection(client, jsonsockmanager(client, self.scheduler))
     self.scheduler.post_event(comm.event(client, comm.event.SOCK_OPEN))
     output.dbg("Connection to " + str(address) + " added", self.__class__.__name__)
Example #2
0
 def receive(self, sock, recvthread):
     """Receive new connection
     """
     client, address = sock.accept()
     if (not comm.BLOCKING):
         client.setblocking(0)
     if (not self.nagle):
         client.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
     recvthread.addconnection(client, ofsockmanager(client, self.scheduler))
     self.scheduler.post_event(comm.event(client,
                                          comm.event.SOCK_OPEN))
     output.dbg("Connection to "+str(address)+" added", self.__class__.__name__)