Example #1
0
 private void ConnectHandler(LNReq_Connect msg, PBChannel channel, int handle, uint seq)
 {
     if (!Enable)
     {
         LogSys.Log(LOG_TYPE.ERROR, "Connect to DataStorNode while DataOperator is Disable");
         return;
     }
     try
     {
         bool   ret      = true;
         string errorMsg = string.Empty;
         LogSys.Log(LOG_TYPE.INFO, "DataStoreClient connect :{0} ", msg.ClientName);
         var reply = NLRep_Connect.CreateBuilder();
         reply.SetResult(ret);
         reply.SetError(errorMsg);
         channel.Send(reply.Build());
     }
     catch (Exception e)
     {
         var reply = NLRep_Connect.CreateBuilder();
         reply.SetResult(false);
         reply.SetError(e.Message);
         channel.Send(reply.Build());
     }
 }
Example #2
0
 private void ConnectHandler(LNReq_Connect msg, PBChannel channel, int handle, uint seq)
 {
     try {
         bool   ret      = true;
         string errorMsg = string.Empty;
         LogSys.Log(LOG_TYPE.INFO, "GMServerClient connect :{0} ", msg.ClientName);
         var reply = NLRep_Connect.CreateBuilder();
         reply.SetResult(ret);
         reply.SetError(errorMsg);
         channel.Send(reply.Build());
     } catch (Exception e) {
         var reply = NLRep_Connect.CreateBuilder();
         reply.SetResult(false);
         reply.SetError(e.Message);
         channel.Send(reply.Build());
     }
 }
Example #3
0
        private void OnConnectReply(NLRep_Connect msg, PBChannel channel, int src, uint session)
        {
            ConnectCallback cb = connect_callback_;

            if (null != cb)
            {
                bool   connectRet = false;
                string errorStr   = "Unknown Error";
                if (msg.Result == true)
                {
                    connectRet = true;
                    errorStr   = "Connect Success";
                }
                else
                {
                    connectRet = false;
                    errorStr   = msg.Error;
                }
                cb(connectRet, errorStr);
            }
        }