Since the server is in listen /accept waiting mode all I should worry about timeout.
I can set the socket to take care of that.
I just test client to send multiple single message - in 5 second interval and reinitialized the client socket each time. Works fine for my task.
It has been a challenge , but I finally have bluetooth connection passing simple text message from client to server.
My task is to be able to utilize such connection as necessary, hence not keeping it in any kinda-of synchronous loop.
At present the communication will always be from client to server , and started by client. .
Basically I am looking for a way to check "is server connected ? ".
I do not see any issues closing the client socket and reinitializing it when new communication is required.
I hope I can instruct server socket (timeout ?) to stay connected in "accept" function...
However, I have been reading up on "select"
<a href="http://man7.org/linux/man-pages/man2/select_tut.2.html">select_tut(2) - Linux manual page</a>[<a href="http://man7.org/linux/man-pages/man2/select_tut.2.html" target="_blank" title="New Window">^</a>]
and wondering if that woudl be "cleaner" way to run this asynchronously by monitoring the state of the connection when necessary.
Maybe I'll be over my head again using select...
Any commentaries (to the subject) or other suggestion will be appreciated.
modified 7-Mar-20 16:40pm.