Skip to content

Commit

Permalink
Merge pull request alibaba#330 from Jaskyer/main
Browse files Browse the repository at this point in the history
fix: linux中长时间反复启动获取性能数据sokcet累增没有释放导致一段时间后ConnectionRefused无法再获取的现象
  • Loading branch information
codeskyblue authored Jul 11, 2023
2 parents 96217b7 + 885f5c3 commit 4518f16
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tidevice/_safe_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def __init__(self, addr: Union[str, typing.Tuple[str, int], socket.socket,
def _cleanup(self):
release_uid(self.id)
if self._dup_sock:
self._dup_sock.shutdown(socket.SHUT_RDWR)
self._dup_sock.close()
self._sock.shutdown(socket.SHUT_RDWR)
self._sock.close()

def close(self):
Expand Down

0 comments on commit 4518f16

Please sign in to comment.