public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* SDP_RETRY_IF_BUSY and timeout of service search process
@ 2009-06-24 22:49 Rodolpho Atoji
  2009-06-25  3:46 ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Rodolpho Atoji @ 2009-06-24 22:49 UTC (permalink / raw)
  To: linux-bluetooth

Hello,

I'm using bluez-3.32 and I would like to know the timeout
for the service search process, with or without using
SDP_RETRY_IF_BUSY.

Reading the code, it's possible to see that the function
sdp_send_req_w4_resp() is used for all the search functions.

So, without using SDP_RETRY_IF_BUSY the timeout
should be the sum of timeouts of sdp_send_req() and
sdp_read_rsp().

The timeout of sdp_send_req() is the timeout of send(),
which is SO_SNDTIMEO. The timeout of sdp_read_rsp()
is SDP_RESPONSE_TIMEOUT, so the timeout of
the service search process without retries should be
SO_SNDTIMEO + SDP_RESPONSE_TIMEOUT, am I
right?

Regarding to the "busy" state of the device, what is
it, exactly?

As shown on (sdp.c:4095):

do {
...
} while (errno == EBUSY && (flags & SDP_RETRY_IF_BUSY));

When SDP_RETRY_IF_BUSY is used, the timeout of
service search process can be indefinitely extended
above the timeout calculated?

Thanks in advance and best regards,

Rodolpho

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SDP_RETRY_IF_BUSY and timeout of service search process
  2009-06-24 22:49 SDP_RETRY_IF_BUSY and timeout of service search process Rodolpho Atoji
@ 2009-06-25  3:46 ` Marcel Holtmann
  2009-06-25 15:15   ` Rodolpho Atoji
  0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2009-06-25  3:46 UTC (permalink / raw)
  To: Rodolpho Atoji; +Cc: linux-bluetooth

Hi Rodolpho,

> I'm using bluez-3.32 and I would like to know the timeout
> for the service search process, with or without using
> SDP_RETRY_IF_BUSY.

I can stop you right here. Our current release is 4.42 and the 3.x
series is fully in maintenance mode.

Regards

Marcel



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SDP_RETRY_IF_BUSY and timeout of service search process
  2009-06-25  3:46 ` Marcel Holtmann
@ 2009-06-25 15:15   ` Rodolpho Atoji
  2009-06-25 15:17     ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Rodolpho Atoji @ 2009-06-25 15:15 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

>> I'm using bluez-3.32 and I would like to know the timeout
>> for the service search process, with or without using
>> SDP_RETRY_IF_BUSY.
>
> I can stop you right here. Our current release is 4.42 and the 3.x
> series is fully in maintenance mode.

Ok!

I'll be moving to 4.42, so I'll update my post based on the 4.42
sources, which are almost the same regarding to the
service search routines:

====== Updated post ======

I'm using bluez-4.42 and I would like to know the timeout
for the service search process, with or without using
SDP_RETRY_IF_BUSY.

Reading the code, it's possible to see that the function
sdp_send_req_w4_resp() is used by all the search functions.

So, without using SDP_RETRY_IF_BUSY the timeout
should be the sum of timeouts of sdp_send_req() and
sdp_read_rsp().

The timeout of sdp_send_req() is the timeout of send(),
which is SO_SNDTIMEO. The timeout of sdp_read_rsp()
is SDP_RESPONSE_TIMEOUT, so the timeout of
the service search process without retries should be
SO_SNDTIMEO + SDP_RESPONSE_TIMEOUT, am I
right?

Regarding to the "busy" state of the device, what is
it, exactly?

As shown on (sdp.c:4526):

do {
...
} while (errno == EBUSY && (flags & SDP_RETRY_IF_BUSY));

When SDP_RETRY_IF_BUSY is used, the timeout of
service search process can be indefinitely extended
above the timeout calculated?

Thanks and best regards,

Rodolpho

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SDP_RETRY_IF_BUSY and timeout of service search process
  2009-06-25 15:15   ` Rodolpho Atoji
@ 2009-06-25 15:17     ` Marcel Holtmann
  2009-06-25 15:23       ` Rodolpho Atoji
  0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2009-06-25 15:17 UTC (permalink / raw)
  To: Rodolpho Atoji; +Cc: linux-bluetooth

Hi Rodolpho,

> >> I'm using bluez-3.32 and I would like to know the timeout
> >> for the service search process, with or without using
> >> SDP_RETRY_IF_BUSY.
> >
> > I can stop you right here. Our current release is 4.42 and the 3.x
> > series is fully in maintenance mode.
> 
> Ok!
> 
> I'll be moving to 4.42, so I'll update my post based on the 4.42
> sources, which are almost the same regarding to the
> service search routines:
> 
> ====== Updated post ======
> 
> I'm using bluez-4.42 and I would like to know the timeout
> for the service search process, with or without using
> SDP_RETRY_IF_BUSY.

and where do we actually use that flag inside bluetoothd? If we do that
is a bug and it needs to be changed to use SDP async API.

Regards

Marcel



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SDP_RETRY_IF_BUSY and timeout of service search process
  2009-06-25 15:17     ` Marcel Holtmann
@ 2009-06-25 15:23       ` Rodolpho Atoji
  2009-06-26  7:04         ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Rodolpho Atoji @ 2009-06-25 15:23 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

>> I'm using bluez-4.42 and I would like to know the timeout
>> for the service search process, with or without using
>> SDP_RETRY_IF_BUSY.
>
> and where do we actually use that flag inside bluetoothd? If we do that
> is a bug and it needs to be changed to use SDP async API.

In fact I use a library which is linked to bluez.

This library does the service search just like sdptool does
in do_search() (sdp.c:3616).

Is this deprecated and shouldn't be used, then?

Regards,
Rodolpho

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: SDP_RETRY_IF_BUSY and timeout of service search process
  2009-06-25 15:23       ` Rodolpho Atoji
@ 2009-06-26  7:04         ` Marcel Holtmann
  0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2009-06-26  7:04 UTC (permalink / raw)
  To: Rodolpho Atoji; +Cc: linux-bluetooth

Hi Rodolpho,

> >> I'm using bluez-4.42 and I would like to know the timeout
> >> for the service search process, with or without using
> >> SDP_RETRY_IF_BUSY.
> >
> > and where do we actually use that flag inside bluetoothd? If we do that
> > is a bug and it needs to be changed to use SDP async API.
> 
> In fact I use a library which is linked to bluez.
> 
> This library does the service search just like sdptool does
> in do_search() (sdp.c:3616).
> 
> Is this deprecated and shouldn't be used, then?

it is not deprecated, but it shouldn't be used. However feel free to fix
it, but as I mentioned we are not even using it. The SDP async API is
what I would recommend.

Regards

Marcel



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-06-26  7:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-24 22:49 SDP_RETRY_IF_BUSY and timeout of service search process Rodolpho Atoji
2009-06-25  3:46 ` Marcel Holtmann
2009-06-25 15:15   ` Rodolpho Atoji
2009-06-25 15:17     ` Marcel Holtmann
2009-06-25 15:23       ` Rodolpho Atoji
2009-06-26  7:04         ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox