Skip to content

Commit

Permalink
修复了 FakeServer 启动后一段时间会自动关闭的错误 (timeout)
Browse files Browse the repository at this point in the history
  • Loading branch information
HIM049 committed Feb 15, 2023
1 parent 7a12880 commit 01470b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hibernate_r/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def fake_server(server: PluginServerInterface):
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, True)
server_socket.bind((fs_ip, fs_port))
server_socket.settimeout(5000)
except:
server.logger.error("伪装服务端启动失败")
server_socket.close()
Expand Down Expand Up @@ -157,7 +156,8 @@ def fake_server(server: PluginServerInterface):
server.logger.warning("[%s:%s]收到了无效数据(%s)" % (client_ip, client_address[1], recv_data))
except Exception as e:
server.logger.error(e)
except:
except Exception as ee:
server.logger.error("发生错误%s" % ee)
server.logger.info("关闭套接字")
server_socket.close()

Expand Down

0 comments on commit 01470b1

Please sign in to comment.