-
-
Notifications
You must be signed in to change notification settings - Fork 308
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
Disconnect hangs sometimes on Windows #788
Comments
Hi @melihercan, I'm the friendly issue checker. |
On the following run it works ok:
|
On the third run, it hung on the Disconnect call: It looks like there is a race condition somewhere on the native Windows path so that the native calls do not complete...
|
So you are saying the same problem also occurs with other devices? Or is it specific to this WGX-iBeacon device? |
@AskBojesen You're the one who contributed the WinConsole demo app (and refactored the Windows BLE implementation). Can you actually reproduce this problem? |
Yes, the same issue occurs on other devices. For example, I used SimCPR GetServicesAsync hanging:
Disconnect hanging:
|
I will try to reproduce and fix now |
I cannot reproduce - @melihercan : Will you give PR #808 a test ? |
@AskBojesen Sure, I will try it tomorrow and let you know. |
@AskBojesen Unfortunately, I wasn't able to test it today due to an interruption from another project. I will check again tomorrow. |
Hi @AskBojesen First I added an extra debug message to mark the end of ShowNumberOfServicesWithDisconnectConnect call.
then I ran the code 3 times: I attach the log file with 3 runs. |
@AskBojesen FYI, I quickly replaced the Window API layer with the following code (implemented only the APIs that I am calling - quick and dirty), and then each time it connects, gets services, and disconnects successfully. No delays, no hanging.
|
@melihercan : But above is not related to the WinConsole client itself. Do you have a better implementation ? then we need that in a new branch! In the WinConsole program I have also added some tests not using the plugin - to troubleshoot errors |
When you write that disconnect hangs - have you then been patient ? I have seen it takes 5 secs to disconnect in windows
|
My idea is to make "demos' in the WinConsole project to reproduce errors, and if I suspect that it is the implementation in the plugin which causes errors, then I make a Pure Windows demo to investigate in parallel. I have just found another error, which I can reproduce every time... I will make a fix for that first. |
I have just reproduced with the latest'n'greatest from master including my last merged PR |
@melihercan : Will you rename this issue to: "Disconnect hangs sometimes on Windows" |
Renamed |
To help us fix your issue, please provide the information in the below template. If something causes a crash, provide as much information as you can gather.
Just imagine: we do not know what you are doing!
Steps to reproduce
Get main branch
Customize the program.cs so that it scans passively 3 times and then calls ShowNumberOfServices on WGX-iBeacon device:
Also change the DoTheScanning debug messages a bit:
Expected behavior
Actual behavior
I have tried with different BLE devices and the issue is reproducible
Crashlog
No crash just hanging. Here is the log:
Configuration
Version of the Plugin: Repo main brach
Platform: Windows 11
Device: WGX-iBeacon
The text was updated successfully, but these errors were encountered: