NetCoreServer icon indicating copy to clipboard operation
NetCoreServer copied to clipboard

Doesn't work in Unity

Open ffMathy opened this issue 4 years ago • 6 comments

If we use this from Unity, the server detects a connection from the client, and the client can send data to the server, but the server can't send data to the client.

This happens with a TCP connection.

ffMathy avatar Feb 18 '20 08:02 ffMathy

My guess would be, that you tried calling a Unity method from another thread when you received data. Sadly on other threads errors are silent and won't show up in Unity's console.

I managed building a unity client for netcoreserver: https://github.com/JohannesDeml/NetCoreServerUnityClient It's still a bit rough on the edges, but it works as a proof of concept I guess :)

JohannesDeml avatar May 13 '20 16:05 JohannesDeml

@ffMathy Cleaned up and documented the code, looks all good and works on localhost as well as for remote servers, so I see no problem in using NetCoreServer with a Unity client. Tested with Editor, Android, iOS and Windows. I made a small release to test the binaries yourself: https://github.com/JohannesDeml/NetCoreServerUnityClient/releases/tag/1.0

Even though the issue is a it older I hope it helps either you or others looking for server solutions :)

JohannesDeml avatar May 14 '20 15:05 JohannesDeml

Hello, is there any lib for Websocket Unity?

nobikin95 avatar May 25 '22 08:05 nobikin95

Hello, is there any lib for Websocket Unity?

I only made sure TCP, UDP and SSL work for now. If you want to extend it, I'm happy to take PRs for the Websocket feature

JohannesDeml avatar May 30 '22 09:05 JohannesDeml

So android confirmed working?

Hanprogramer avatar Dec 17 '23 15:12 Hanprogramer

For TCP, UDP and SSL in Unity: Yes, I tested it back then with this repo: https://github.com/JohannesDeml/NetCoreServerUnityClient

I wouldn't see a reason that this does not work for a non unity build :)

JohannesDeml avatar Dec 17 '23 18:12 JohannesDeml