From: Marcel Holtmann <marcel@holtmann.org>
To: bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] RFCOMM non-blocking support
Date: Mon, 11 Apr 2005 14:56:35 +0200 [thread overview]
Message-ID: <1113224195.9655.37.camel@pegasus> (raw)
In-Reply-To: <000901c53e1a$d8e07e30$0201a8c0@NBVICTOR>
Hi Victor,
> This was already discussed a year ago:
> question:
> http://sourceforge.net/mailarchive/message.php?msg_id=8643791
> reply:
> http://sourceforge.net/mailarchive/message.php?msg_id=8643793
>
> I have exactly the same problem, I guess.
>
> Instead of EINPROGRESS non-blocking connect() returns EAGAIN (Resource
> temporarily unavailable). The rest seem to be OK (see the source). Select
> waits till the connection is established or an error occurs (at least as it
> looks from hcidump log).
I just checked the code and the problem is the bt_sock_wait_state()
function. In the case of O_NONBLOCK we give it a timeout of 0 and this
means that it will exit with EAGAIN if sk->sk_state != state. This
actually means that also L2CAP is not working correct in the non
blocking case. How do we should fix this? The easiest way seems to add
another check to bt_sock_wait_state() before entering the while loop:
if (!timeo && sk->sk_state != state)
return -EINPROGRESS;
Another way is to add a flags parameter to this function or deal with it
in the L2CAP/RFCOMM connect functions.
Regards
Marcel
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
prev parent reply other threads:[~2005-04-11 12:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-09 19:24 [Bluez-devel] gumstix & bluez (infineon) Brad Midgley
2005-04-10 22:15 ` [Bluez-devel] RFCOMM non-blocking support Victor Shcherbatyuk
2005-04-11 12:56 ` Marcel Holtmann [this message]
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=1113224195.9655.37.camel@pegasus \
--to=marcel@holtmann.org \
--cc=bluez-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.