receiving data over a python socket

前端 未结 1 1288
有刺的猬
有刺的猬 2021-01-01 00:29

I\'m making a program that retrieves decently large amounts of data through a python socket and then immediately disconnects when the information is finished sending. But I\

相关标签:
1条回答
  • 2021-01-01 01:13

    You've probably missed a very important part of those examples - the lines that follow the "recv()" call:

    while 1:
        data = conn.recv(1024)
        if not data: break
        conn.send(data)
    conn.close()
    
    0 讨论(0)
提交回复
热议问题