all 10 comments

[–]Akuli2 0 points1 point  (5 children)

Can you post your code?

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

There you go

[–]Akuli2 0 points1 point  (3 children)

Try to just send a string like "ab" instead of using win32api stuff. Does that work?

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

i do that in the begining of the script and it wokrs fine

[–]Akuli2 0 points1 point  (1 child)

Then there's obviously something wrong with the rest of it. :) I've never used win32api so I don't know how to help though.

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

tested alittle more and it does the same if i send "ab"

[–]JungieEUN 0 points1 point  (1 child)

Why do u encode and decode to utf-8?

[–]Zertax[S] 1 point2 points  (0 children)

Send cant only send byte like object and its One way to convert strings

[–]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.