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

GetQueuedCompletionStatusEx does not return #35

Open
valeriob opened this issue Jan 15, 2020 · 3 comments
Open

GetQueuedCompletionStatusEx does not return #35

valeriob opened this issue Jan 15, 2020 · 3 comments

Comments

@valeriob
Copy link
Contributor

Hi,
i got to this point using netmq library, i'm using a SubscriberSocket to connect to a remote publisher, on a netcore 3.01 console application.

I run the application with normal connectivity and it works as expected, i receive data.
Then i unplug the network (disable wifi for example) and correctly the api SubscriberSocket.TryReceiveFrameBytes returns false, if i turn on the network then on some computers (windows 10 1909) it start working again, on some other (same windows version and same .netcore version) it remain stuck.

I diagnosed the problem a bit thanks to netmq and asyncio source code, i got to this line of code

bool result = UnsafeMethods.GetQueuedCompletionStatusEx(m_completionPortHandle,

The issue seems like that this call never returns if i unplug the network.

The even stranger thing is that if i unplug the network for less that 10seconds it recovers, otherway it does not 😄

I'm sorry if i'm not able to provide any further detail, and i could not understand what's differente on the computers to cause the problem (wifi driver ?). Do you have any adivce on how to diagnose/ fix the problem ?
Thanks

@wmjordan
Copy link
Contributor

wmjordan commented Jan 15, 2020

I also met with this type of issue, years ago, while my application was targeting .NET Framework 4, on both Win10 and Win2008. Since my application was communicating with a lot of IoT devices, this could occur quite frequently.

The workaround is to set a timeout to the GetQueuedCompletionStatusEx and recycle the Overlapped instances within AsyncSocket after a long-enough period to reclaim the resources.

@wmjordan
Copy link
Contributor

Maybe you can also take a look at #26.

@valeriob
Copy link
Contributor Author

Thanks @wmjordan !
Unfortunatly i'm not familiar with completition port api :(

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