4

So any fellow Socket.io dev here know how to reduce the delay of my app? When I send an event it sometimes takes like 10 seconds to send the data to the server then to 2 other clients using io.sockets.emit. I'm on LAN where the server and the sender client is connected with a switch then the receiver is on wifi which is connected to the same switch so it's not far away.

Anyways it uses WEBSOCKETS so it should be fast right???!?! Is windows keeping my packets back? (poor packets :( they just wanna arrive :( )

Comments
  • 0
    I've used socket.io and server.js with websockets on Windows and I can tell you that windows (my laptop/desktop) have no lag whatsoever.
    It might be some other factor,
    But I'm a noob as well, so sorry can't help much
  • 1
    @byte well the problem is that the lag kinda comes randomly... also it feels like when there are more than 1 events they get buffered and delayed. But the longest that came was around 15 seconds (from win PC -> win server -> linux PC) interesting though maybe it didn't switch to websockets then... Thanks anyways
  • 1
    @byte found a way to do it. Send a random (can be any) event continously like every 500ms then it's guaranteed to not be buffered by any of the OSs.
  • 0
    @notcool well for me it seems to be some buffering on the client's size as after the event there are no packets sent on the wire (yeah I've checked with wireshark XD) Well if I keep sending it works instantly.
  • 0
    Make sure you're using sockets and not polling :)
Add Comment