How to make socket.recv(x_bytes) return exactly x_bytes no more no less

前端 未结 0 909
醉酒成梦
醉酒成梦 2020-11-22 07:12

I\'m using Python 3 but assume Python 2 would work similarly

I want to have a python TCP socket receive exactly x_bytes.

msg = sock.recv(x_bytes)


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题