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 ?

2

1 Answer 1

-1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.