How can I reconnect a socket after a broken pipe?

前端 未结 2 570
栀梦
栀梦 2020-12-19 05:35

The program connects to a server, and when the connection is closed by the server, if I try to reconnect it says: socket.error: [Errno 9] Bad file descriptor

2条回答
  •  北海茫月
    2020-12-19 06:08

    Assuming this is a connection oriented socket:

    No. You have to close the old one and create a new socket,

提交回复
热议问题