Added a sock connected in the ReceiveThread function

This should hopefully break connection to socket, but I doubt this will
solve the problem.