Skip to content

BluetoothSocket.InputStream should throw a System.IO.IOException #3646

Closed
@kwintAl

Description

@kwintAl

BluetoothSocket.InputStream is a Stream and Stream.Read should throw a System.IO.IOException

Steps to Reproduce

  1. Create SPP RFCOMM Connection
_adapter = BluetoothAdapter.DefaultAdapter;
// ...
var device = _adapter.GetRemoteDevice(address);
var socket = device.CreateRfcommSocketToServiceRecord(UUID.FromString("00001101-0000-1000-8000-00805F9B34FB"));
await socket.ConnectAsync();
var stream = socket.InputStream;
  1. start read operation
try {
     var buffer = new byte[128];
     var read = stream.Read(buffer, 0, buffer.Length);
    // ...
}
catch(IOException e) {
    throw;
}
catch (Exception e)
{
    // Java.IO.IOException...
    throw;
}
  1. turn remote device off and wait few seconds

Expected Behavior

System.IO.IOException

Actual Behavior

Java.IO.IOException

Version Information

Log File

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions