asyncio, multiple servers and [Errno 104] ECONNRESET #15612
Replies: 2 comments 2 replies
-
I thought it might be a problem with all 3 servers using the same callback, so made 3 servers calling their specific callback function. Still get the error. Seems to be something fundamentally wrong in my attempts. def main():
print('awaiting client connection ...')
asyncio.create_task(heartbeat(1000))
server1 = await asyncio.start_server(handle_ping, config.server, 8089)
server2 = await asyncio.start_server(handle_gate_alarm, config.server, 8091)
server3 = await asyncio.start_server(handle_camera_alarm, config.server, 8090)
# serve forever
async with server1, server2, server3:
while True:
await asyncio.sleep(3600)
# connect to hotspot
connect()
asyncio.run(main()) |
Beta Was this translation helpful? Give feedback.
2 replies
-
Apparently, one server can handle multiple clients on a single port ... so I am closing this and going back to a single server. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to run 3 servers each listening to a different port on one ESP32 (1.24 SPIRAM and ESP32-GENERIC) and sometimes get
[Errno 104] ECONNRESET
The relevant part of the code:
I was getting this error when running only one server and hoped running three servers would sort it. As far as I understand the 3 servers are associated with the 3 different ports. The error seems to occur when two clients are sending messages at roughly the same time.
Any suggestions are where to look for the problem?
Thank you.
Edit:
maybe relevant:
#13533
micropython/micropython-lib#788
Beta Was this translation helpful? Give feedback.
All reactions