Clean up socket handlers