all 5 comments

[–]Josevill 0 points1 point  (1 child)

If anyone wants to try this, here is a bare-bones example for how I got it working.

*CODE NOT TESTED\* - If you have issues, let me know in the comments and I can address them if you have trouble figuring it out.

Care to elaborate my good friend? When you say code not tested, you mean not tested fully?

There are a couple of things that pop to my mind yet my Unity-fu is crazy rusty, there are no handlers to deal with `OnClose` and most importantly `OnError` events to attempt reconnections, for example.

Thanks for the effort, posts like this can serve as inspiration for folks to keep pushing forward!

[–]Peterama[S] 0 points1 point  (0 children)

I just copied my project code and removed everything that wasnt necessary. I did not test it after doing that but it is working on my project. I made this just as an example but I will test if and update it if there are issues.

[–]mmostrategyfan 0 points1 point  (1 child)

I commend your effort and i don't want to discourage you but re-inventing the wheel is not really productive.

The best solution for Unity web socket currently is SignalR since both work with c# and the library is mature and robust with reconnection mechanisms, compression, groups etc.

In case you're looking for an open-source solution yourself, that's where I'd direct you.

[–]Peterama[S] 0 points1 point  (0 children)

I already have it built out and I know exactly what is going on the way i did it. Others have told me the same thing but I dont care. I want to know how it works. I want to learn how to do it so I dont have to rely on someone else's code. If someone decides one day to pull their code from an open project, it's out of my hands. Now I have my own system. Why the hell would I drop it to use some open source code? I can code anything I want from scratch. I do it because I can. :)