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

Cannot send data unless an event is currently active #170

Open
NateKomodo opened this issue Mar 5, 2020 · 6 comments
Open

Cannot send data unless an event is currently active #170

NateKomodo opened this issue Mar 5, 2020 · 6 comments

Comments

@NateKomodo
Copy link

When trying to call websocket.Send() from anywhere else other than a subscribed event (When it is called) the data is not sent. The data is sent fine if i am calling the method from inside the DataRecievedEvent, but not anywhere other than a method.

@NateKomodo
Copy link
Author

NateKomodo commented Mar 5, 2020

I have found a temporary workaround, if i Thread.sleep an event and then try sending from another thread, it works, because umm, code?

Although this also blocks the entire websocket

@NateKomodo NateKomodo changed the title Cannot send data unless from a subscribed event Cannot send data unless an event is currently active Mar 5, 2020
@NateKomodo
Copy link
Author

If there is no event running at the same time ws.Send is called, ws.Send hangs forever

@bPoller2810
Copy link

@NateKomodo did you find any relyable workaround?

@NateKomodo
Copy link
Author

@bPoller2810 I switched library

@bPoller2810
Copy link

@NateKomodo sorry if i have to bother you again. i may have a few questions what environment you used.
was yours a wpf/winforms or xamarin app?
did if work at any point before?
what did you think could have caused that it stopped working?
what lib did you choose then?

i am facing the same problem right now.

@NateKomodo
Copy link
Author

I was using a .NET framework app I was running through mono, never worked before. I imagine the cause is a race condition, scoping issue, or poor design/bug that has resulted in data being unable to be sent while an event instance is not invoking.
I believe I switched to a library called Extensions.WebSockets that I found on nuget, as it supported self signed certificates

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