Home > Mobile >  socket tcp package no delay
socket tcp package no delay

Time:11-06

I want to send two packages one by one:

conn.send('package_1')
conn.send('package_2')

The question is it will be assembled in one package, because the interval of these to package is small. I don't want this to happen. So I found s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1), but it still doesn't work.

In client, it still receive a package like this package_1package_2

similar to this question

CodePudding user response:

That's how TCP works. TCP is not a message protocol. If you want a message protocol, you have to implement (or choose) one.

  • Related