Skip to content

Commit

Permalink
add destructor to TCPAsyncSocketConnection class
Browse files Browse the repository at this point in the history
  • Loading branch information
preeded authored and kevinkjt2000 committed Dec 8, 2021
1 parent d647b4e commit 988f241
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mcstatus/protocol/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,11 @@ async def read(self, length):
def write(self, data):
self.writer.write(data)

def close(self):
self.writer.close()
def __del__(self):
try:
self.writer.close()
except:
pass


class UDPAsyncSocketConnection(AsyncReadConnection):
Expand Down

0 comments on commit 988f241

Please sign in to comment.