Beispiel #1
0
 def add_connection(self):
     connection = {
         "id": self.socket.id,
         "init_time": helpers.get_cur_srv_time_ms(),
         "messages": 0
     }
     connections_collection.insert(connection,
                                   callback=self._add_connection_cb)
Beispiel #2
0
    def open(self,*args):
        self.id = self.get_argument("Id")
        self.stream.set_nodelay(True)
        self.conn_handler = ConnectionsHandler(socket=self)
        self.conn_handler.add_connection()


        clients[self.id] = {"id":self.id, "object" : self, "init_time": helpers.get_cur_srv_time_ms()}

        self.write_message("Hello friend")
        print "WebSocket %s opened" % (self.id)
Beispiel #3
0
    def open(self, *args):
        self.id = self.get_argument("Id")
        self.stream.set_nodelay(True)
        self.conn_handler = ConnectionsHandler(socket=self)
        self.conn_handler.add_connection()

        clients[self.id] = {
            "id": self.id,
            "object": self,
            "init_time": helpers.get_cur_srv_time_ms()
        }

        self.write_message("Hello friend")
        print "WebSocket %s opened" % (self.id)
Beispiel #4
0
 def add_connection(self):
     connection = {"id":self.socket.id, "init_time": helpers.get_cur_srv_time_ms(), "messages":0}
     connections_collection.insert(connection, callback=self._add_connection_cb)