Hi,

I am using Linux kernel ver 2.6.32 along with bluez 4.95. I have issue with "rfcomm listen".


Description of problem:
From the rfcomm man page:

listen dev channel cmd
Listen on a specified RFCOMM channel for incoming connections. When the child process terminates or the client disconnect, the command will terminate.

Unfortunately, rfcomm process does not terminate and must be killed manually with Ctrl-C.

Steps to Reproduce:
1. Start a listening process:
$ sudo rfcomm -i hci0 listen 1

2. If needed, add a serial service discoverable via SDP:
$ sdptool add --channel=1 SP

3. Connect with a remote to this serial port. The PC process should show the connection:
Connection from xx:xx:xx:xx:xx:xx to /dev/rfcomm1
Press CTRL-C for hangup

4. Terminate the connection from the remote and observe that the process does not terminate. This channel is now locked and the remote cannot reconnect until the listening is manually killed and restarted. This of course prevents watch from working like expected.

watch dev channel cmd
Watch is identical to listen except that when the child process terminates or the client disconnect, the command will restart listening with the same parameters.