refactor core modules, integrate network stats

This commit is contained in:
Username
2025-12-25 11:13:20 +01:00
parent 2201515b10
commit 269fed55ff
8 changed files with 270 additions and 219 deletions

View File

@@ -111,6 +111,15 @@ class RsHttp():
def get_last_rocksock_exception(self):
return self.last_rs_exception
def disconnect(self):
"""Safely close the underlying connection."""
if hasattr(self, 'conn') and self.conn:
try:
self.conn.disconnect()
except:
pass
self.conn = None
def _err_log(self, s):
if self.log_errors:
sys.stderr.write(s + '\n')