Esempio n. 1
0
        public static void Stop()
        {
            lock (syncLock)
            {
                if (traceSink != null)
                {
                    traceSink.Stop(null);
                }

                traceSink = null;
            }
        }
Esempio n. 2
0
        public static void Start(NetTraceSinkDelegate onReceive)
        {
            lock (syncLock)
            {
                IPEndPoint traceEP;
                IPAddress  traceAdapter;
                Config     config;

                config       = new Config("Diagnostics");
                traceEP      = config.Get("TraceEP", new IPEndPoint(Helper.ParseIPAddress(NetTrace.DefTraceGroup), NetTrace.DefTracePort));
                traceAdapter = config.Get("TraceAdapter", IPAddress.Any);

                if (traceSink != null)
                {
                    traceSink.Stop(null);
                    traceSink = null;
                }

                traceSink = new NetTraceSink();
                traceSink.Start(traceEP, traceAdapter, onReceive);
            }
        }