Skip to contentSkip to conversation

nonblocking connect : Wrong return code ?

Bluez-users wim delvaux 2 participants 2 messages Dec 4, 2004 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

when using a nonblocking socket,

when the connect is requested the errno that is returned is 11. (resource temporarily unavailable)

Man page says that it should be EINPROGRESS (which is 115).

Man page for connect says :

EINPROGRESS :

The socket is non-blocking and the connection cannot be completed immediately. It is possible to select(2) or poll(2) for completion by selecting

but

EAGAIN :

No more free local ports or insufficient entries in the routing cache

EAGAIN is a proper return code for this situations for read or write but not for connect ...

-------------------------------------------------------
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://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

maintainer
#1 lore raw

Hi Wim,

Quoted 16 lines

when using a nonblocking socket,

when the connect is requested the errno that is returned is 11. (resource temporarily unavailable)

Man page says that it should be EINPROGRESS (which is 115).

Man page for connect says :

EINPROGRESS :

The socket is non-blocking and the connection cannot be completed immediately. It is possible to select(2) or poll(2) for completion by selecting

but

Quoted 7 lines

EAGAIN :

No more free local ports or insufficient entries in the routing cache

EAGAIN is a proper return code for this situations for read or write but not for connect ...

we had this questions a long time ago and I never got a final answer from anyone what is the right way to do. However the change must be done in bt_sock_wait_state() and you must check rfcomm/sock.c, l2cap.c and sco.c if it is still working as expected. Feel free to send in a patch for it.

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://productguide.itmanagersjournal.com/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users