Re: Fw: Question about the connect Function and BlueZ.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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).



--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux