mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Fixed crash during BT connection
PiperOrigin-RevId: 527656444
This commit is contained in:
committed by
Copybara-Service
parent
83739b3185
commit
4b27e8c446
@@ -310,7 +310,6 @@ std::unique_ptr<api::BluetoothSocket> BluetoothClassicMedium::ConnectToService(
|
||||
}
|
||||
nearby::CancellationFlagListener cancellation_flag_listener(
|
||||
cancellation_flag, [&rfcomm_socket]() {
|
||||
rfcomm_socket->CancelIOAsync().get();
|
||||
rfcomm_socket->Close();
|
||||
});
|
||||
|
||||
|
||||
@@ -195,12 +195,6 @@ ExceptionOr<ByteArray> BluetoothSocket::BluetoothInputStream::Read(
|
||||
}
|
||||
}
|
||||
|
||||
IAsyncAction BluetoothSocket::CancelIOAsync() {
|
||||
// Cancels pending reads and writes over a StreamSocket object.
|
||||
// https://docs.microsoft.com/en-us/uwp/api/windows.networking.sockets.streamsocket.cancelioasync?view=winrt-20348
|
||||
return windows_socket_.CancelIOAsync();
|
||||
}
|
||||
|
||||
Exception BluetoothSocket::BluetoothInputStream::Close() {
|
||||
NEARBY_LOGS(INFO) << __func__ << ": Close bluetooth input stream.";
|
||||
|
||||
|
||||
@@ -98,8 +98,6 @@ class BluetoothSocket : public api::BluetoothSocket {
|
||||
bool Connect(HostName connectionHostName,
|
||||
winrt::hstring connectionServiceName);
|
||||
|
||||
IAsyncAction CancelIOAsync();
|
||||
|
||||
private:
|
||||
static constexpr int kInitialTransmitPacketSize = 4096;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user