Example #1
0
 private static string GetMessageTypeAsString(Ice1Definitions.MessageType type)
 {
     return(type switch
     {
         Ice1Definitions.MessageType.RequestMessage => "request",
         Ice1Definitions.MessageType.RequestBatchMessage => "batch request",
         Ice1Definitions.MessageType.ReplyMessage => "reply",
         Ice1Definitions.MessageType.CloseConnectionMessage => "close connection",
         Ice1Definitions.MessageType.ValidateConnectionMessage => "validate connection",
         _ => "unknown",
     });
Example #2
0
        internal static void TraceSend(Communicator communicator,
                                       byte[] buffer, ILogger logger, TraceLevels tl)
        {
            if (tl.Protocol >= 1)
            {
                var iss = new InputStream(communicator, buffer);
                iss.Pos = 0;

                using var s = new System.IO.StringWriter(CultureInfo.CurrentCulture);
                Ice1Definitions.MessageType type = PrintMessage(s, iss);

                logger.Trace(tl.ProtocolCat, "sending " + GetMessageTypeAsString(type) + " " + s.ToString());
            }
        }
Example #3
0
        internal static void TraceRecv(Ice.InputStream str, Ice.ILogger logger, TraceLevels tl)
        {
            if (tl.Protocol >= 1)
            {
                int p = str.Pos;
                str.Pos = 0;

                using (var s = new System.IO.StringWriter(CultureInfo.CurrentCulture))
                {
                    Ice1Definitions.MessageType type = PrintMessage(s, str);

                    logger.Trace(tl.ProtocolCat, "received " + GetMessageTypeAsString(type) + " " + s.ToString());
                }
                str.Pos = p;
            }
        }