enhance socket management