Python socket send EOF

后端 未结 3 1797
滥情空心
滥情空心 2021-02-05 14:58

I have a simple file transfer socket program where one socket sends file data and another socket receives the data and writes to a file

I need to send an acknowledgme

3条回答
  •  死守一世寂寞
    2021-02-05 15:00

    Writing and reading from a socket are separate. You can try to close a socket for writing and leave it open for reading.

    See http://docs.python.org/library/socket.html#socket.socket.shutdown

    Also, what FTP does is use two sockets: one for data, and one for this "confirmation".

    You'd be happier using a second socket for this additional metadata.

提交回复
热议问题