-1

I am trying to send and receive file over TCP with Python. But recv() method get only 4KB of files, rest is discarded. How can ı get all bytes in file?

dtkr
  • 1
  • 2

1 Answers1

1

recv is a low-level interface. It will read "bufsize" (defaults to 4k) bytes at a time. You need to keep calling it until it returns zero bytes back to you to get all the data.

See here for more: https://docs.python.org/3/howto/sockets.html#using-a-socket

user2199860
  • 788
  • 4
  • 14