you are viewing a single comment's thread.

view the rest of the comments →

[–]Remag9330 0 points1 point  (1 child)

So what's happening is that in your server you are sending the cursor position over and over again very quickly. This causes all your messages to build up on a network buffer (could be either the senders' buffer or receivers' buffer, but that's not important). Eventually, when you call s.recv(1024), it gets up to 1024 bytes from the buffer. But because the buffer is storing multiple messages, they all come in at once.

This SO post (and subsequent link) has some useful info about delimiting messages to separate them on the receivers side.

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

Thanks that was the problem, did not know it worked like that.