Beispiel #1
0
def stats_sock(ws):
    while True:
        msg = ws.receive()
        if msg is not None:
            token = msg
            database_helper.stats_info.add_entry(token, ws)
            database_helper.notify_all_users()
        else:
            break
Beispiel #2
0
def stats_sock(ws):
    while True:
        msg = ws.receive()
        if msg is not None:
            token = msg
            database_helper.stats_info.add_entry(token, ws)
            database_helper.notify_all_users()
        else:
            break
Beispiel #3
0
def sock(ws):
    while True:
        msg = ws.receive()
        if msg is not None:
            email = msg

            if database_helper.socket_pool.is_socket_presented(email):
                old_sock = database_helper.socket_pool.get_socket(email)
                try:
                    old_sock.send('bye')
                    database_helper.socket_pool.change_socket_by_email(email, ws)
                except:
                    pass
            else:
                database_helper.socket_pool.add_socket(email, ws)

            database_helper.notify_all_users()
        else:
            break

    database_helper.notify_all_users()
Beispiel #4
0
def sock(ws):
    while True:
        msg = ws.receive()
        if msg is not None:
            email = msg

            if database_helper.socket_pool.is_socket_presented(email):
                old_sock = database_helper.socket_pool.get_socket(email)
                try:
                    old_sock.send('bye')
                    database_helper.socket_pool.change_socket_by_email(
                        email, ws)
                except:
                    pass
            else:
                database_helper.socket_pool.add_socket(email, ws)

            database_helper.notify_all_users()
        else:
            break

    database_helper.notify_all_users()