/// <summary>
        /// Closes and clears the socket, without causing exceptions.
        /// </summary>
        private void ResetSocket()
        {
            // Close the socket
            ClientSocket.Close();
            ClientSocket       = null;
            ClientSocketReader = null;

            // Indicate there is no socket connection
            ClientSocketState = SocketState.Closed;
        }