try to close the channel after a socket.error