Exemplo n.º 1
0
        /* This function will send the "StopApplicationRequest" and end the application session.
         * It also closes the TCP socket and the reader and writer streams attached to it.
         * */
        public void StopApplicationSession(string session_id)
        {
            try
            {
                // Get the XML string for "StopApplicationRequest" and send the request
                xmlHandler.sendRequest(XMLFormatter.FormatStopApplicationSessionRequest(session_id));
                string response = xmlHandler.readXMLMessage();

                // Close the TCP Socket connection.
                if (socket_handle.closeSocket())
                {
                    Console.WriteLine("Socket close operation performed successfully");
                }
                else
                {
                    Console.WriteLine("Error encountered during socket close operation");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception at StopApplicationSession: {0}", ex.Message);
                return;
            }
        }