From: David Sainty <david.sainty@dtsp.co.nz>
To: "Abraham J. Velez (EndoraSoft)" <ajvelez@endorasoft.es>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: Fw: Question about the connect Function and BlueZ.
Date: Tue, 25 Aug 2009 09:19:46 +1200 [thread overview]
Message-ID: <4A9303F2.1090709@dtsp.co.nz> (raw)
In-Reply-To: <FC8DB2E521304A449D5398632C2186C8@TSESUO>
Abraham J. Velez (EndoraSoft) wrote:
> Hi,
>
> The errno works but if the socket is NON-Blocking always is 115
> (EINPROGRESS).
>
> We need to know if the user has cancel the connexion or the connexion
> has broken by timeout.
>
Did you read what I sent? Especially the references to using poll() and
getsockopt()?
It sounds like your problem is solved by getting the final error code
from connect() non-blocking? And that's how you do it.
>>
>> Does this not work? From connect(2):
>>
>> EINPROGRESS
>> The socket is non-blocking and the connection cannot
>> be com-
>> pleted immediately. It is possible to select(2) or
>> poll(2) for
>> completion by selecting the socket for writing. After
>> select(2)
>> indicates writability, use getsockopt(2) to read the
>> SO_ERROR
>> option at level SOL_SOCKET to determine whether
>> connect() com-
>> pleted successfully (SO_ERROR is zero) or
>> unsuccessfully
>> (SO_ERROR is one of the usual error codes listed here,
>> explain-
>> ing the reason for the failure).
>>
>>
prev parent reply other threads:[~2009-08-24 21:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-22 20:50 Fw: Question about the connect Function and BlueZ Abraham J. Velez (EndoraSoft)
2009-08-22 21:20 ` David Sainty
2009-08-24 17:19 ` Abraham J. Velez (EndoraSoft)
2009-08-24 21:19 ` David Sainty [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=4A9303F2.1090709@dtsp.co.nz \
--to=david.sainty@dtsp.co.nz \
--cc=ajvelez@endorasoft.es \
--cc=linux-bluetooth@vger.kernel.org \
/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