public static void Stop() { lock (syncLock) { if (traceSink != null) { traceSink.Stop(null); } traceSink = null; } }
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); } }