public void TermNet() { if (RxRunning) { RxRunning = false; nif.Close(); LOG.WriteLine(TraceEventType.Information, (int)DEV9LogSources.NetAdapter, "Waiting for RX-net thread to terminate.."); rxThread.Join(); LOG.WriteLine(TraceEventType.Information, (int)DEV9LogSources.NetAdapter, "Done"); nif.Dispose(); nif = null; } }
public int Open() { NetAdapter na = GetNetAdapter(); if (na == null) { LOG.WriteLine(TraceEventType.Critical, (int)DEV9LogSources.NetAdapter, "Failed to GetNetAdapter()"); } else { net.InitNet(na); } return(0); }
//rx thread void NetRxThread() { try { NetPacket tmp = new NetPacket(); while (RxRunning) { while (smap.RxFifoCanRx() && nif.Recv(ref tmp)) { smap.RxProcess(ref tmp); } System.Threading.Thread.Sleep(1); } } catch (Exception e) { LOG.MsgBoxErrorTrapper(e); throw; } //return 0; }