LiveOrDevTrying / WebsocketsSimple

WebsocketsSimple provides an easy-to-use and customizable Websocket Server and Websocket Client. The server is created using a TcpListener and upgrades a successful connection to a WebSocket. The server and client can be used for non-SSL or SSL connections and authentication (including client and server SSL certification validation) is provided for identifying the clients connected to your server. Both client and server are created in .NET Standard and use async await functionality.
Apache License 2.0
21 stars 2 forks source link

NetStandard 2.1 version of packages seem not to work #11

Open farlop opened 5 months ago

farlop commented 5 months ago

Hi! I want to add WebSocket Server capabilities to an existing Xamarin application (to perform inter-app communications), so I'm using version 2.1.78 of the packages. Somehow, I can't get clients to connect to the server from other apps in the same device.

I've tried using a new MAUI App with latest 7.0.9 version as Server, and it works perfectly, but as soon as I downgrade that MAUI App to 2.1.78, it behaves the same way as the Xamarin App.

Could there be a problem in the 2.1.X versions?

Thank you!

LiveOrDevTrying commented 5 months ago

Hello,

Thank you for using WebsocketsSharp! I will check 2.1 versions and see if there are any problems. I will post after I check.

Thanks! Rob

LiveOrDevTrying commented 5 months ago

So 2.1.X is built for .NET Standard 2.1. It sounds like it is working with MAUI App v7.0.9. But when dropping MAUI app down to 2.1.X, the same packages are no longer working.

Is this correct? If yes, are you receiving any errors in the console or from OnErrorEvent? If yes, can you share this event / console message?

If not, can you share a stripped repo showing this problem so I can debug? If you would rather, can you download the source and add to the project directly and add breakpoints from client OnMessageEvent being sent to OnMessageEvent on server and if that message is being sent / received correctly? If yes, can you add breakpoints from server OnMessageEvent to client OnMessageEvent and verify sending / receiving correctly?

Def would like to get this fixed but need to understand a touch more what's explicitly going on.

Thank you! Rob

farlop commented 4 months ago

After some testing, it seems that the Maui App was working after all. Sorry for the confusion.

What I haven't manage to get it working is the Xamarin Application using the version 2.1.78. Unfortunately, nothing is shown either in console or on OnErrorEvent event.

I've uploaded the repo of the Xamarin App I'm using. You can get it from here: https://github.com/farlop/WebsocketsSimple-Xamarin

There:

Thank you! And sorry for the confusion