From: Marcel Holtmann <marcel@holtmann.org>
To: BlueZ users <bluez-users@lists.sourceforge.net>
Subject: Re: [Bluez-users] Timeout for connections
Date: Sun, 03 Dec 2006 22:15:10 +0100 [thread overview]
Message-ID: <1165180510.19590.68.camel@localhost> (raw)
In-Reply-To: <b5dccebe0612031122h4d49b82ehb26400eb1e350437@mail.gmail.com>
Hi Mikael,
> > > I would like to be able to set a timeout for service discoveries (and
> > > eventually for rfcomm connections as well, but so far I've been
> > > experimenting with service discoveries). For this I use non blocking
> > > sockets by passing SDP_NON_BLOCKING to sdp_connect. Then I use select
> > > with a timeout on the socket, and if it times out I call sdp_close.
> > >
> > > The problem is that after I have done this I can't use the bluetooth
> > > chip for other connections for some time. Dumping the traffic with
> > > hcidump, I saw that this is because even though the l2cap socket is
> > > closed, the bluetooth chip is still doing the connection in the
> > > background. For this connection to actually get canceled the chip
> > > needs to be sent a HCI_Create_Connection_Cancel command, but it is not
> > > sent when the socket is closed.
> >
> > use a 2.6.19 kernel and this command will be sent.
> >
>
> Oh ok... Haven't had to build my own kernel before but I guess there
> is a first time for everything... I'm using ubuntu and they say it
> won't be available until next version in april... Problem is that
> there are people who I can't tell "build the latest kernel" who relies
> on the software I'm developing... what to do...
there is a chance that Fedora Core will update their kernel to 2.6.19
very soon. Otherwise you are out of luck.
> Is there another way I can set a timeout for connections?
No. Only the kernel can keep track of connections. If you try to do it
by yourself in userspace you will break more than you fix. The reference
count for the ACL link is tricky and only the kernel has all needed
information to do it right.
Regards
Marcel
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
next prev parent reply other threads:[~2006-12-03 21:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-03 18:30 [Bluez-users] Timeout for connections Mikael Lindqvist
2006-12-03 18:40 ` Marcel Holtmann
2006-12-03 19:22 ` Mikael Lindqvist
2006-12-03 21:15 ` Marcel Holtmann [this message]
2006-12-04 8:36 ` Mikael Lindqvist
2006-12-04 8:45 ` Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1165180510.19590.68.camel@localhost \
--to=marcel@holtmann.org \
--cc=bluez-users@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox