exit connection process when socket error