V
V
Vadim Apenko2018-10-16 13:25:06
Python
Vadim Apenko, 2018-10-16 13:25:06

Is it possible to organize a non-blocking connection wait in Socket + Python?

Micropython (python3)
At the socket.accept() stage, the program freezes at this point and this is not acceptable for me.
There is a loop inside with the main logic while True: which cannot be interrupted.

So here's the question. Is it possible inside the while True: loop to track the connection and pass it to the handler function so that it responds to the client, but the loop is not interrupted while waiting for the connection?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Tikhonov, 2018-10-16
@tumbler

* separate thread
* asyncio

Z
Zanak, 2018-11-05
@Zanak

soket.setblocking(False)
isn't it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question