Click here to Skip to main content
15,867,308 members
Home / Discussions / Linux Programming
   

Linux Programming

 
GeneralRe: SOLVED Re: More advise wanted - how to run TWO loops ? Pin
CPallini3-Apr-20 5:42
mveCPallini3-Apr-20 5:42 
AnswerRe: More advise wanted - how to run TWO loops ? Pin
Member 1330167920-Dec-20 23:35
Member 1330167920-Dec-20 23:35 
QuestionSeeking professional advise... Pin
Vaclav_9-Mar-20 19:14
Vaclav_9-Mar-20 19:14 
AnswerRe: Seeking professional advise... Pin
k505410-Mar-20 4:29
mvek505410-Mar-20 4:29 
GeneralRe: Seeking professional advise... Pin
Vaclav_10-Mar-20 5:12
Vaclav_10-Mar-20 5:12 
GeneralRe: Seeking professional advise... Pin
Richard MacCutchan10-Mar-20 5:48
mveRichard MacCutchan10-Mar-20 5:48 
AnswerRe: Seeking professional advise... Pin
Joe Woodbury9-Jul-20 7:41
professionalJoe Woodbury9-Jul-20 7:41 
QuestionUsing bluetooth connection asynchronously - C++ Pin
Vaclav_7-Mar-20 8:49
Vaclav_7-Mar-20 8:49 
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"

<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.

QuestionReturn indicates failure , errno indicates status? Pin
Vaclav_6-Mar-20 6:06
Vaclav_6-Mar-20 6:06 
AnswerRe: Return indicates failure , errno indicates status? Pin
k50546-Mar-20 6:34
mvek50546-Mar-20 6:34 
GeneralRe: Return indicates failure , errno indicates status? Pin
Vaclav_6-Mar-20 8:18
Vaclav_6-Mar-20 8:18 
GeneralRe: Return indicates failure , errno indicates status? Pin
Richard MacCutchan6-Mar-20 21:42
mveRichard MacCutchan6-Mar-20 21:42 
GeneralRe: Return indicates failure , errno indicates status? Pin
k50547-Mar-20 4:55
mvek50547-Mar-20 4:55 
GeneralRe: Return indicates failure , errno indicates status? Pin
Vaclav_7-Mar-20 6:01
Vaclav_7-Mar-20 6:01 
GeneralRe: Return indicates failure , errno indicates status? Pin
Richard MacCutchan8-Mar-20 1:29
mveRichard MacCutchan8-Mar-20 1:29 
GeneralRe: Return indicates failure , errno indicates status? Pin
Member 1330167920-Dec-20 23:40
Member 1330167920-Dec-20 23:40 
GeneralRe: Return indicates failure , errno indicates status? Pin
Richard MacCutchan20-Dec-20 23:48
mveRichard MacCutchan20-Dec-20 23:48 
AnswerRe: Return indicates failure , errno indicates status? Pin
Member 1330167920-Dec-20 23:40
Member 1330167920-Dec-20 23:40 
QuestionUsing ba2str fails - why ? Pin
Vaclav_4-Mar-20 4:59
Vaclav_4-Mar-20 4:59 
AnswerRe: Using ba2str fails - why ? Pin
ZurdoDev4-Mar-20 5:14
professionalZurdoDev4-Mar-20 5:14 
GeneralRe: Using ba2str fails - why ? Pin
Vaclav_4-Mar-20 5:36
Vaclav_4-Mar-20 5:36 
AnswerRe: Using ba2str fails - why ? Pin
ZurdoDev4-Mar-20 5:48
professionalZurdoDev4-Mar-20 5:48 
GeneralRe: Using ba2str fails - why ? Pin
k50544-Mar-20 5:54
mvek50544-Mar-20 5:54 
AnswerRe: Using ba2str fails - why ? Pin
k50544-Mar-20 5:20
mvek50544-Mar-20 5:20 
AnswerRe: Using ba2str fails - why ? Pin
Richard MacCutchan4-Mar-20 5:34
mveRichard MacCutchan4-Mar-20 5:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.