Adrian Moldovan
Adrian Moldovan

Reputation: 443

WebSocket4Net synchronous calls

I might missing something on documentation but there is any possibility when the 'Send' method is called to wait for the answer and not through a callback method?

Upvotes: 0

Views: 855

Answers (1)

Adrian Moldovan
Adrian Moldovan

Reputation: 443

Because was used different threads I used ManualResetEvent. After send method (from WebSocket) was called the thread was put on hold using WaitOne method from ManualResetEvent and on ws response the Set method was called and the response was read from a local variable.

Upvotes: 1

Related Questions