0

I have a python client-server where one of the tasks is to send 10 messages in a row to the client. The problem is, the client receives only 1 message being the concatenation of the 10 messages sent. The code looks like this.

client:
while 1:
        msg = self.connection.recv(1024).decode()
        print (msg)

server:
for i in range (10):
    client.send(i.encode())

Client should receive, 0, then 1, then 2, then 3... but he doesn't. He gets 0123456789.

Is there a way to force unique sendings? Or do i have to code a parsing system ?

Waroulolz
  • 297
  • 9
  • 23

1 Answers1

-1

you can reduce the number of bytes for recv(). That will do the trick.

FelixSFD
  • 6,052
  • 10
  • 43
  • 117