I'm running on a Debian Bullseye container. The container has access to a rfcomm device on the host and I'm using a listener to detect if the connection is closed to try and reconnect the device. This works well up to a point when the program gets several disconnection events in a row and then freezes while trying to reconnect.
The reconnection mechanism just calls closePort waits a few seconds and tries to call openPort again
Running jconsole remotely shows that there's a live thread running waitForEvent so I assume the listener it's still registered in the SerialPort instance.
I'm running on a Debian Bullseye container. The container has access to a
rfcommdevice on the host and I'm using a listener to detect if the connection is closed to try and reconnect the device. This works well up to a point when the program gets several disconnection events in a row and then freezes while trying to reconnect.The reconnection mechanism just calls
closePortwaits a few seconds and tries to callopenPortagainRunning
jconsoleremotely shows that there's a live thread runningwaitForEventso I assume the listener it's still registered in theSerialPortinstance.