Skip to content
Commit 189964ae authored by Robert Lubos's avatar Robert Lubos Committed by Carles Cufí
Browse files

samples: net: sockets: packet: Make sure all sockets are closed on exit



First off, fix the FD check when closing a socket - currently not all
sockets were closed on exit (0 is also a valid file descriptor).

Second issue is the use of k_thread_abort() on tx/rx threads. The
receving thread was blocked in recv(), and aborting its thread prevented
it from ending gracefully (i. e. the socket mutex allocated in recv()
was not released as the function did not exit properly). This resulted
on a consecutive `close()` call lock. Fix this by setting a timeout on a
receiving socket, and instead of aborting threads allowing them to exit
gracefully.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent 5b34d25b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment