When keeping a client socket open to send several messages, why does the program give an error when there is a big delay in messages?

后端 未结 2 1739
后悔当初
后悔当初 2020-12-22 13:16

There is a server that listens to connections. The client socket connects to the server and calls sendall() several times in a loop before closing it. However,

2条回答
  •  粉色の甜心
    2020-12-22 14:16

    Your server code is incorrect. You should use threading or any other technique to serve multiple client connections. What is happening here:

    1) Server accepts first socket

    2) Server receives 72 bytes

    3) Connection is closed because with operator closes it

    4) Server goes to next accept-loop

提交回复
热议问题