Fix hanging socket