* [Bluez-devel] How to detect disconnected slaves?
@ 2007-06-18 9:54 Mikael Bengtsson
0 siblings, 0 replies; only message in thread
From: Mikael Bengtsson @ 2007-06-18 9:54 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1.1: Type: text/plain, Size: 1246 bytes --]
Hello!
I'm developing an application in which there will be two SCO channels and three RFCOMM channels. There are sockets connected to every channel and sending and receiving on the sockets are done with "read" and "write" on the socket descriptors.
If one or more several of these channels are lost, the application shall try to restart them.
What is the easiest way to detect that a channel is lost?
For an RFCOMM channel i have tried to check if the number of received bytes equals 0 to determine if the channel is lost according to TCP/IP programming, but the condition is never fulfilled. I think that I can solve the problem if the application first sends a command to the slave and then waits for an answer. If the slave doesn't answer within, say 1 second, then the connection is considered lost. With one-way sending, I don't know how to check if the connection is lost. Maybe som sort of "heartbeat" manner must be used?
For SCO I don't have a clue.
Are there any low-level functions that may be used?
-Mikael
_________________________________________________________________
Sök på vilken webbsida som helst med hög säkerhet. Skaffa Windows Live Toolbar i dag -- helt gratis!
http://toolbar.live.com
[-- Attachment #1.2: Type: text/html, Size: 1492 bytes --]
[-- Attachment #2: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-06-18 9:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-18 9:54 [Bluez-devel] How to detect disconnected slaves? Mikael Bengtsson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox