2

I have a game server made in Node.js, and am building a Unity3D client for it. I have already built a pure Javascript web client for the same server as well, which works great.

I was able to build the client for Unity3D using the websocket-sharp, but it is kind of slow, and was wondering if there are any better libraries to use such as UNET that would for for this.

daniel metlitski
  • 747
  • 3
  • 11
  • 23
  • 'kind of slow'? as in how? – mgear Feb 14 '17 at 02:26
  • @mgear every couple of seconds i dont seem to get a packet for a small delay of time, whereas my javascript client gets the packets much quicker with no delays. also the websockets-sharp library uses slow things like foreach loops in their code – daniel metlitski Feb 14 '17 at 02:33
  • maybe that library has some big buffer it receives, before it processes data? hard to know without code.. I use normal System.Net.Sockets, no delay receiving data from node.js , going to use this next https://github.com/RevenantX/LiteNetLib – mgear Feb 14 '17 at 03:19
  • Do you know of any resources that I can use as an example to make my websocket client with System.Net.Sockets? Im having some trouble getting started with a prototype, I did find examples for making a server though – daniel metlitski Feb 14 '17 at 03:55
  • http://wiki.unity3d.com/index.php/Simple_TCP/IP_Client_DLL_Code – mgear Feb 14 '17 at 04:03
  • By the way @mgear the LiteNetLib uses UDP sockets only, Websockets work over TCP so that one would not work – daniel metlitski Feb 17 '17 at 02:05
  • 1
    I would love to know a good answer to this as well. All searches turn up websocket usage for WebGL in Unity. I don't care about WebGL - I am talking about native apps. Why is it assumed that you only want to use websockets if you are building something browser based? – pspahn Apr 06 '17 at 04:22
  • @pspahn My app is for both native as well as WebGL – daniel metlitski Apr 06 '17 at 06:05

0 Answers0