Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Socket exception: The operation completed successfully. #76

Closed
jcs090218 opened this issue Jul 17, 2020 · 4 comments
Closed
Assignees

Comments

@jcs090218
Copy link
Contributor

I am trying to connect to my raspberry pi device, yet no luck doing it. I am getting Socket exception: The operation completed successfully. message and I have no idea why is an error message saying something successfully? 😕

Here is the code, what am I doing wrong? Thanks!

var cli = new BluetoothClient();
IReadOnlyCollection<BluetoothDeviceInfo> peers = cli.DiscoverDevices();

foreach (var bdi in peers)
{
    print(bdi.DeviceName);

    if (bdi.DeviceName == "raspberrypi")
        mDevice = bdi;
}

if (mDevice != null)
    print("Address: " + mDevice.DeviceAddress);

// Error here!
cli.Connect(mDevice.DeviceAddress, BluetoothService.SerialPort);

NetworkStream stream = cli.GetStream();
@jcs090218
Copy link
Contributor Author

Okay, the same code works in normal C# application but not in Unity. :(

@peterfoot peterfoot self-assigned this Aug 3, 2020
@peterfoot
Copy link
Member

This should be resolved in 4.0.7 which was just published on NuGet

@jcs090218
Copy link
Contributor Author

Thanks! I will try this when I have time! 😄

@jcs090218
Copy link
Contributor Author

I have tested with version 4.0.8! Thanks! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants