I am trying to get data from a TCP Connection (client side only) using Python as programming language,
However, I could see that all data are not received in once and are cut in the middle of the receiving process ... I could see on forums that TCP does not send data in the correct order (it is a bit random, link: Python socket receive - incoming packets always have a different size), am I wrong ?
My question is if there is anyway to make sure that I correctly received all data?
Thanks in advance for your help and replies,
PS: I already increased the buffer size of socket.recv(), but still facing the same issue ... And I am only working under CentOS
EDIT: (couldn't reply to my own question :( Still beginner on this forum :) )
Hi,
Thanks a lot for your reply, indeed I don't have to worry about the TCP connection :)
After investigating more, I could finally find the solution ... (I was searching for a few days before posting my question here),
If anyone needs an answer, in python you must wait for the full message, otherwise the message can be cut, so this means:
data = s.recv(1024, socket.MSG_WAITALL) --> 's' is a socket object created in the python code,
Kind regards