* RFCOMM connection timeout question (rfcomm/sock.c)
@ 2008-07-17 9:33 Mateusz
0 siblings, 0 replies; only message in thread
From: Mateusz @ 2008-07-17 9:33 UTC (permalink / raw)
To: linux-bluetooth
Hello,
I'm trying to understand the following piece of kernel code in rfcomm/sock.c.
rfcomm_sock_connect -> rfcomm_dlc_open -> bt_sock_wait_state
The last procedure waits until the sk's state changes to BT_CONNECTED.
1. When creating sk socket the sk_sndtimeo member of sk is initialized
to RFCOMM_CONN_TIMEOUT, which in my kernel code is HZ * 30 which, as I
see it, should be 30 seconds. However after enabling debug, I can see
that the timeout returned by sock_sndtimeo is 7500. How could this
be?
2. What is the role of the bt_sock_wait_state? If timeout expires it
returns error code 115 (EINPROGRESS). What does the situation look
like here? Is the client still trying to connect to a remote device?
If so, how should the client program handle this error code? Is
ignoring it a good option or should it rather call the
rfcomm_socket_release function? What would happen if the client tried
to connect to the same remote device using rfcomm_sock_connect after
receiving this error code? Is there a way to notify the client that
the connection was made (BT_CONNECTED) without waiting on the
bt_sock_wait_state function.
3. Is there a way to control this timeout in a more flexible fashion
or is it impossible due to some BT specification bits?
Thanks in advance for all the answers. Your support and suggestions
are greatly appreciated.
Best wishes,
Mateusz
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-07-17 9:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-17 9:33 RFCOMM connection timeout question (rfcomm/sock.c) Mateusz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox