示例#1
0
        private static void WriteAny(Dictionary <string, object> information)
        {
            string hostName;

            if (information.ContainsKey(ConfigurationPropertyName.BeaconLogServerName) &&
                information[ConfigurationPropertyName.BeaconLogServerName] != null &&
                !string.IsNullOrEmpty(((string)information[ConfigurationPropertyName.BeaconLogServerName]).Trim()))
            {
                hostName = (string)information[ConfigurationPropertyName.BeaconLogServerName];
            }
            else
            {
                //default is broadcast
                hostName = IPAddress.Broadcast.ToString();
            }

            // Build the binary buffer of the logging information by TsapDataBuilder.
            byte[] buffer = TsapDataBuilder.Build(information);

            // UDP packets on a fixed port, 58727
            try
            {
                udpClient.Send(buffer, buffer.Length, hostName, tsapPort);
            }
            catch (SocketException)
            {
                // Ignore SocketException exceptions.
            }
        }
示例#2
0
        public static byte[] Build(IDictionary <string, object> information)
        {
            TsapDataBuilder builder = new TsapDataBuilder(information);

            builder.BuildClientDescription();
            builder.BuildServerDescription();
            builder.BuildTestDescription();

            return(builder.ConvertMessage());
        }
        public static byte[] Build(IDictionary<string, object> information)
        {
            TsapDataBuilder builder = new TsapDataBuilder(information);

            builder.BuildClientDescription();
            builder.BuildServerDescription();
            builder.BuildTestDescription();

            return builder.ConvertMessage();
        }