static BinaryStreamWriter GetMails_3(object __serviceObj, Session __client, BinaryStreamReader __reader)
		{
			var __timer = TimeCounter.BeginNew();
			IMailServerImpl __service = (IMailServerImpl)__serviceObj;
			string userId;
			int __reqId;
			__reader.Read(out __reqId);
			__reader.Read(out userId);
		#if (DEBUG || LOG_PROTOCOL)
			Log.Debug("GetMails  reqId: {0}, userId: {0}",  __reqId, userId);
		#endif
			var reply = new IMailServer_GetMailsCallback(__reqId, __client.Connection);
			try
			{
				__service.GetMails(__client, userId, reply);
			}
			catch(ServiceException e)
			{
				reply.Error(e.ErrCode, e.Message);
			}
			catch(Exception e)
			{
				Log.Error("Generic Service Invoke Failed, clientId:{0} error message:{1}\nCall Stack: {2}", __client.ID, e.Message, e.StackTrace);
				reply.Error((int)ServiceErrorCode.Generic, "generic service error.");
			}
			PerfStatistic.AddItem("IMailServer.GetMails", (int)__timer.End());
			return null;
		}
예제 #2
0
        public override bool Read()
        {
            if (reader.PeekChar() == -1)
            {
                return(false); // End of stream reached
            }
            var count = RawTypes.Length;
            var data  = CurrentRow;

            for (var i = 0; i < count; i++)
            {
                var rawType = RawTypes[i];
                data[i] = streamReader.Read(rawType);
            }
            return(true);
        }
예제 #3
0
 public override bool Read()
 {
     try
     {
         var count = RawTypes.Length;
         var data  = CurrentRow;
         for (var i = 0; i < count; i++)
         {
             var rawType = RawTypes[i];
             data[i] = streamReader.Read(rawType);
         }
         return(true);
     }
     catch (EndOfStreamException)
     {
         return(false);
     }
 }
 public override bool Read()
 {
     try
     {
         var count = RawTypes.Length;
         var data  = CurrentRow;
         for (var i = 0; i < count; i++)
         {
             var rawType = RawTypes[i];
             data[i] = streamReader.Read(rawType);
         }
         return(true);
     }
     catch (EndOfStreamException)
     {
         // HACK this is a horrible hack related to the fact that GZip-compressed stream
         // does not provide a Peek method for some reason, forcing us to only be able to
         // detect EOF by actually trying to read
         return(false);
     }
 }
		static BinaryStreamWriter Login_1(object __serviceObj, Session __client, BinaryStreamReader __reader)
		{
			var __timer = TimeCounter.BeginNew();
			IAgentServerImpl __service = (IAgentServerImpl)__serviceObj;
			string userId;
			__reader.Read(out userId);
		#if (DEBUG || LOG_PROTOCOL)
			Log.Debug("Login userId: {0}", userId);
		#endif
			__service.Login(__client, userId);
			PerfStatistic.AddItem("IAgentServer.Login", (int)__timer.End());
			return null;
		}