Introduced threading locks and stop event for safer socket management. Updated the receive loop to handle connection interruptions.
Introduced threading locks and stop event for safer socket management. Updated the receive loop to handle connection interruptions.