sta / websocket-sharp

A C# implementation of the WebSocket protocol client and server
http://sta.github.io/websocket-sharp
MIT License
5.74k stars 1.66k forks source link

Error: Operation is not supported on this platform #601

Open cooltrain7 opened 4 years ago

cooltrain7 commented 4 years ago

I've been running socket-sharp for 3 weeks now just fine (.net Core 2.1). Its started to throw this

System.PlatformNotSupportedException: Operation is not supported on this platform. at System.Action 1.BeginInvoke(T obj, AsyncCallback callback, Object object) at WebSocketSharp.WebSocket.open() at WebSocketSharp.WebSocket.Connect() | System.Exception {System.PlatformNotSupportedException}

I'm simply calling using (ws = new WebSocketSharp.WebSocket(Address)) { ws.Connect(); //Other stuff after }

and it throws after connect.

anpin commented 4 years ago

I just tried to make a port of an app to UWP and I got the same error

danielmackay commented 4 years ago

I'm getting the same error also. Running on .NET Core 3.1.

vitaliy-art commented 4 years ago

I have same problem. I'm using secure connection and in one of ten cases (or so) program throws System.PlatformNotSupportedException after connect to server. When connection is nonsecure, it works fine.

ManOfYellowKing commented 4 years ago

I use connectasync() to connect to server,it throws the same error, but it works fine when I use connect. Running on .NET Core 3.1.

danielmackay commented 4 years ago

Thanks for the suggestion, i'll give it a try.

On Thu, 23 Apr 2020 at 18:38, brad.liu notifications@github.com wrote:

I use connectasync() to connect to server,it throws the same error, but it works fine when I use connect. Running on .NET Core 3.1.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sta/websocket-sharp/issues/601#issuecomment-618264387, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUDWYCTPN5BZPAGRKQ4MYLRN75AZANCNFSM4LMXWGUA .

tomerpeled commented 4 years ago

@bradliuvskysoft thanks for the workaround, it indeed works without async. Good for my test env...

nixxholas commented 4 years ago

Am working on a proper fork currently. Should finish basic support in a week. @tomerpeled https://github.com/nozomi-ai/websocket-sharp