As per #433, terminate the server while the client is executing a MySQL statement (e.g., DO SLEEP(10);). A SocketException is thrown (An established connection was aborted by the software in your host machine). The raw SocketException shouldn't be thrown; it should be wrapped in a MySqlException.