Bug fix: Products No image

This commit is contained in:
Mann Patel
2025-03-24 23:04:12 -06:00
parent fc125cc76a
commit e7a6e1dd8b
5 changed files with 139 additions and 106 deletions

View File

@@ -0,0 +1,24 @@
import asyncio
import websockets
async def handle_client(websocket, path):
try:
# Receive user ID
user_id = await websocket.recv()
print(f"Received user ID: {user_id}")
# Optional: You can add more logic here if needed
except websockets.exceptions.ConnectionClosed:
print("Client disconnected")
except Exception as e:
print(f"Error processing request: {str(e)}")
async def start_server():
server = await websockets.serve(handle_client, "localhost", 5555)
print("WebSocket server started")
await server.wait_closed()
# Run the server
if __name__ == "__main__":
asyncio.run(start_server())