Beispiel #1
0
        protected virtual void handleEndSession()
        {
            String response;
            int    terminate = 0;

            if (!mainThread.Connected())
            {
                mainThread.closeSocket();
                actualState = 0;
            }
            if (actualState == 1)
            {
                mainThread.writeSocket("ENDSESSION");
                mainThread.writeSocket(sessionID);
                actualState = 2;
            }

            if (actualState == 2)
            {
                response = responseThread.readSocket();
                if (response == "OK")
                {
                    terminate = 1;
                }
                else if ((response == "") && (!mainThread.Connected()))
                {
                    terminate = 1;
                }
                if (terminate == 1)
                {
                    mainThread.closeSocket();
                    actualState = 0;
                }
            }

            if (actualState == 0)
            {
                operation = 0;
            }
        }
Beispiel #2
0
 void OnDisable()
 {
     s_tcp.closeSocket();
 }