Using bluetooth connection asynchronously - C++
-
Edit 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"
select_tut(2) - Linux manual page[^]
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.
-
Edit 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"
select_tut(2) - Linux manual page[^]
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.
It's time to travel, to learn, to experience new things. I am also [url=https://royalessays.co.uk/\]writing essays[/url] and studying extra books outside of class.