Exit on a socket error