Re: [Bluez-devel] L2CAP: One failing connection hurts others?

Stefan Mischke
2004-09-15T22:26:50Z

Hi Marcel!

Marcel Holtmann schrieb:

>use the linger support of the L2CAP socket and put a "sleep 2" between
>the first and the second l2test call.
>
>
>
I'll give it a try tomorrow.
I already tried the lingering option to be able to close the socket
directly after the last send, but it didn't work for me. I had to put a
sleep 1000 (ms) to prevent read errors. As much as I understood the man
pages....

"When enabled, a *close
<http://www.die.net/doc/linux/man/man2/close.2.html>*(2) or *shutdown
<http://www.die.net/doc/linux/man/man2/shutdown.2.html>*(2) will not
return until all queued messages for the socket have been successfully
sent or the linger timeout has been reached. Otherwise, the call returns
immediately and the closing is done in the background. When the socket
is closed as part of *exit*(2), it always lingers in the background."

...disabling linger makes also a clean shutdown in the background. Is
there also a timeout for background lingering?

Anyway, thanks a lot for your help. I really appreciate it. I'll test
your linger suggestion tomorrow. But I'm still of the opinion that l2cap
should not return errno 16 to connection attempts to reachable devices
even if a connection attempt is in progress to an unreachable device.
There should be some concurrency possible.

Regards
Stefan