Represents a message originating from a peer, state server or client (web server)
Inheritance: HTTPMessage
示例#1
0
 public static void TagMessage(ServiceMessage Msg)
 {
     Msg.Tag = new Tag();
     ((Tag)Msg.Tag).Timer.Start(); //Start the timer on this message
 }
示例#2
0
 public static void LogReply(ServiceMessage Msg, ResponseData Response)
 {
     Stopwatch timer = ((Tag)Msg.Tag).Timer;
     timer.Stop();
     Debug.WriteLine( "[" + GetFormattedTime(DateTime.Now) + "] " + string.Format("Replied Message {0} with {1} . Processed in {2} ms \n", Msg.Tag, Response.ResponseType.Name, timer.ElapsedMilliseconds ), "MESSAGING");
 }
示例#3
0
 public static void LogNewMessage(ServiceMessage Msg)
 {
     if (Msg is ServiceRequest || Msg is GetTransferMessage)
     {
         Debug.WriteLine( "[" + GetFormattedTime(DateTime.Now) + "] " + string.Format("Received {0} Message ID {1} for resource {2} from {3}\n", Msg.GetType().Name, Msg.Tag, Msg.Resource, Msg.Source), "MESSAGING");
     }
     else
     {
         Debug.WriteLine( "[" + GetFormattedTime(DateTime.Now) + "] " + string.Format("Received {0} Message ID {1} from {2}\n", Msg.GetType().Name, Msg.Tag, Msg.Source), "MESSAGING");
     }
 }
示例#4
0
 public static void LogMessageUnprotectedError(ServiceMessage Msg)
 {
     Debug.WriteLine( "[" + GetFormattedTime(DateTime.Now) + "] " + string.Format("Error: Unencrypted message content from {0} Message ID {1} for resource {2} -- expected encrypted message \n", Msg.GetType().Name, Msg.Tag, Msg.Resource), "MESSAGING");
 }
示例#5
0
 public static void LogMessageError(ServiceMessage Msg, Exception ex)
 {
     Debug.WriteLine( "[" + GetFormattedTime(DateTime.Now) + "] " + string.Format("Error processing {0} Message ID {1} for resource {2}. Error Message {3} occured at {4}\n", Msg.GetType().Name, Msg.Tag, Msg.Resource, ex.Message, ex.StackTrace), "MESSAGING");
 }
示例#6
0
 public static void LogIgnoredMessage(ServiceMessage Msg, string Reason)
 {
     Debug.WriteLine( "[" + GetFormattedTime(DateTime.Now) + "] " + string.Format("Ignored Message {0}. Reason: {1}\n", Msg.Tag, Reason), "MESSAGING");
 }