Esempio n. 1
0
        internal static void Dump(string name, SocketAddress btsa)
        {
            var bldr = new System.Text.StringBuilder(3 * btsa.Size);

            for (int i = 0; i < btsa.Size; ++i)
            {
                bldr.AppendFormat(System.Globalization.CultureInfo.InvariantCulture,
                                  "{0:X2} ", btsa[i]);
            }
            if (bldr.Length > 0)
            {
                bldr.Length -= 1;
            }
            var t = string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                  "SA @ {0,9}: family: {1} 0x{1:X}, size: {2}, < {3} >",
                                  name, btsa.Family, btsa.Size, bldr.ToString());

            Debug.WriteLine(t);
            MiscUtils.ConsoleDebug_WriteLine(t + ".");
        }