C# 如何设置32英尺的自定义连接超时

C# 如何设置32英尺的自定义连接超时,c#,bluetooth,32feet,C#,Bluetooth,32feet,我正在用C#开发与自定义蓝牙设备通信的代码。我用来连接设备的代码基本上如下所示: BluetoothDeviceInfo device_info = new BluetoothDeviceInfo(BluetoothAddress.Parse(address_str)); try { BluetoothClient connection = new BluetoothClient(); connection.Connect(device_info.DeviceAddress, B

我正在用C#开发与自定义蓝牙设备通信的代码。我用来连接设备的代码基本上如下所示:

BluetoothDeviceInfo device_info = new BluetoothDeviceInfo(BluetoothAddress.Parse(address_str));
try
{
    BluetoothClient connection = new BluetoothClient();
    connection.Connect(device_info.DeviceAddress, BluetoothService.SerialPort);

    if (connection.Connected)
    {
        ...
    }
    else
    {
        ...
    }
}
catch (Exception e)
{
    ...
}
问题是连接呼叫通常在大约5秒后超时。有时它会在大约3秒钟后成功,我有理由相信,如果我允许更多的时间,可以成功建立连接。但是,我没有设置这个5秒的超时时间。我只是调用Connect方法,它会在某个时刻超时

有没有办法在32英尺内的某个地方配置此超时