cleaned up debug messages
This commit is contained in:
parent
181686189c
commit
8dabfec885
@ -114,7 +114,7 @@ class ConnectionHandler(object):
|
|||||||
socket: websockets.WebSocketServerProtocol,
|
socket: websockets.WebSocketServerProtocol,
|
||||||
login_msg: str):
|
login_msg: str):
|
||||||
msg = parse_message(login_msg)
|
msg = parse_message(login_msg)
|
||||||
print(msg)
|
print("new incomming connection...")
|
||||||
if msg is None:
|
if msg is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -474,7 +474,7 @@ class ConnectionHandler(object):
|
|||||||
async def handle_message(self, conn, msg_str):
|
async def handle_message(self, conn, msg_str):
|
||||||
msg = parse_message(msg_str)
|
msg = parse_message(msg_str)
|
||||||
|
|
||||||
print(msg)
|
print("incoming message" + msg)
|
||||||
|
|
||||||
if msg is None:
|
if msg is None:
|
||||||
return None
|
return None
|
||||||
|
7
main.py
7
main.py
@ -29,19 +29,17 @@ DatabaseConnection(db_host,
|
|||||||
async def socket_worker(websocket, path):
|
async def socket_worker(websocket, path):
|
||||||
connection = None
|
connection = None
|
||||||
|
|
||||||
print("new incomin connection")
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
raw_msg = await websocket.recv()
|
raw_msg = await websocket.recv()
|
||||||
|
|
||||||
connection = await ch.new_connection(websocket, raw_msg)
|
connection = await ch.new_connection(websocket, raw_msg)
|
||||||
|
|
||||||
print(ch.open_connections_by_id)
|
|
||||||
print(ch.open_connections_by_user)
|
|
||||||
|
|
||||||
if connection is None:
|
if connection is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
print("successfull logged in user: " + connection.user_name)
|
||||||
|
|
||||||
async for m in websocket:
|
async for m in websocket:
|
||||||
await ch.handle_message(connection, m)
|
await ch.handle_message(connection, m)
|
||||||
|
|
||||||
@ -59,7 +57,6 @@ async def socket_worker(websocket, path):
|
|||||||
id = None
|
id = None
|
||||||
if connection:
|
if connection:
|
||||||
id = connection.user_name
|
id = connection.user_name
|
||||||
print(ch.open_connections_by_id)
|
|
||||||
await ch.disconnect(connection)
|
await ch.disconnect(connection)
|
||||||
await connection.close()
|
await connection.close()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user