Trying to debug the sudden close of a cnnection