Re: [Bluez-devel] modify RFCOMM_DISC_TIMEOUT

Marcel Holtmann
2004-07-23T09:39:14Z

Hi Carlos,

> I run a rfcomm server built on top of bluez using sockets, the client runs a
> different bluetooth protocol implementation that is very buggy and sometimes
> stops the rfcomm comunication without sending a DISC. So the rfcomm server
> waits for 20 seconds (RFCOMM_DISC_TIMEOUT) and then closes the connections
> and become available again. The sending loop of the server is:
>
> //using sockets
> //send until write returns -1
> while(n>=0)
> {
> n=write(client,s,strlen(s));
> sleep(1);
> }
> //go to listen again
>
>
> If the client simply stops the communication, not disconnect, the server
> must be available as soon as possible. 20 seconds it's too long for our
> application.

what you want is an idle timeout detection. The RFCOMM_DISC_TIMEOUT is
not meant for doing this. Show us the output of "hcidump -x -t" while
this happens.