Close connection in socket timeout