macOS Bluetooth: report RemoteHostClosed error when the RFCOMM channel is closed


The ChannelDelegate::channelClosed() virtual method is called in two
cases:
* when an attempt to open the channel failed (because of the timeout
  or an error in rfcommChannelOpenComplete() callbalk).
* when the rfcommChannelClosed() callback is triggered. This happens
  only when the remote host closes the connection.

In the first case we set UnknownSocketError. Keep this behavior.

In the second case no error was reported, which is different from how
other backends behave. This patch updates the code to set the
RemoteHostClosed error if the channelClosed() is called, and the
socket was in Connected state.

Task-number: QTBUG-123430
Pick-to: 6.8 6.7 6.5
Change-Id: Ie21a2e66b570a32b1c4401305738515bc6d04f85
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
commitc382034457ccfecff110adf95c13b1091771063f
parent05b8398aa6f1a6e109d92da6a2d6a8b2d9b0e47f
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeMon, 26 Aug 2024 15:31:46 +0200