After having successful socket connection (specially when using Bluetooth medium), is there any way to check whether remote connected device is still connected?
Re: Is there any ping or similar method to check whether remote
But my situation is bit different. I am not reading from the socket continuesly. One peer should be waiting for other peer's response. And this waiting period will be infinite if the waiting peer does not get any response from its connected peer. And if the connected peer is disconnected, waiting peer will be waiting for response. So I want to check (let's say in every 5 sec), whether connected peer is still connected and keep waiting. That's why I am looking for some method like ping to check the status of connected link. And the communication has to be synchronized in such way that one peer should be waiting for other peer's response. After receiving the response, the waiting peer should response and responded peer should wait.
Re: Is there any ping or similar method to check whether remote
Well, I'm not familiar with Bluetooth programming, but when I used GPRS I made use of NifMan (Network Interface Manager): I could observe the status of the connection. I don't know if NifMan can be used for Bluetooth or there is another component with a similar feature. In any case, I can tell you that it's a common practice in P2P communications that you read from a socket continuously: if you've just received something then start reading again asap. For example, if processing of incoming datamay take long, then do it asynchronously so that you can listen to incoming data asap. You never know when the other peer wants to send you a message, that's why you have to be as responsive as possible. And, as a side-effect, this would solve problem.
I re-read my post (see coloured comments) and completed my the sentences. Wondering how anyone could understand it at all ...
Re: Is there any ping or similar method to check whether remote
Actually I was thinking something like that. But considering limited resource of processor, I thought there might be some API or something implemented. Finally I think I have to chose asynchronous socket reading solution. Thanks anyway!
Forum posts: 723
Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/
Forum posts: 68
Forum posts: 723
I re-read my post (see coloured comments) and completed my the sentences. Wondering how anyone could understand it at all ...
Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/
Forum posts: 68
Forum posts: 16
Per aspera ad astra