public override string sendRequest(string reqXML, Ice.Current current)
 {
     if (serverManager.GetNbConnections() == 0)
         serverManager.Reset();
     AutoResetEvent stopWaitHandle = new AutoResetEvent(false);
     IGRequest curReq = serverManager.ProcessRequest(reqXML, stopWaitHandle);
     if (curReq.GetId() == IGRequest.IGREQUEST_WORKSPACE_DISCONNECT)
     {
         IGAnswerDisconnected answer = new IGAnswerDisconnected(null);
         answer.SetAttribute(IGRequest.IGREQUEST_USERLOGIN, curReq.GetParameterValue(IGRequest.IGREQUEST_USERLOGIN));
         curReq.SetResult(answer.GetXml());
     }
     else if (!IGSMAnswer.IsSMError(curReq.GetId()))
     {
         if (!stopWaitHandle.WaitOne(HC.REQUEST_PROCESSING_TIMEOUT)) // wait for request processed event (10s timeout)
         {
             IGAnswer error = new IGSMAnswer((int)IGSMAnswer.IGSMANSWER_ERROR_CODE.IGSMANSWER_ERROR_TIMEOUT, "Following request did not respond in time: " + curReq.ToString());
             error.SetReqGuid(curReq.GetGuid());
             Console.WriteLine("sending error: " + error.GetXml());
             if (curReq.UserConnection != null)
                 curReq.UserConnection.Reset(IGServerManager.IGSERVERMANAGER_AUTHORITY);
             return error.GetXml();
         }
     }
     return curReq.GetResult();
 }
Exemplo n.º 2
0
 protected override bool PreProcess()
 {
     if (m_reqProc == null)
         return false;
     if (m_reqProc.GetReqId() == IGRequest.IGREQUEST_WORKSPACE_CONNECT)
     {
         IGAnswerDisconnected answerDisconnected = new IGAnswerDisconnected(m_connection);
         answerDisconnected.Execute();
         return true;
     }
     return false;
 }
Exemplo n.º 3
0
 private void onProcessExited(object o, EventArgs eventArgs)
 {
     if (m_connection == null)
         return;
     IGRequestProcessing.Cleanup(m_connection);
     if (m_bReseting)
     {
         m_bReseting = false;
         Initialize();
         m_connection.Initialize();
     }
     else
     {
         IGConnectionLocal resetConnection = (IGConnectionLocal)m_connection;
         if (resetConnection.IsUserConnected() ||
             resetConnection.IsUserConnecting())
         {
             IGAnswerDisconnected answerDisconnected = new IGAnswerDisconnected((IGConnectionLocal)m_connection);
             answerDisconnected.Execute();
         }
         ResetConnection(m_connection);
         m_connection.Initialize();
     }
 }