public Ethernet(string device_name)
{
for(int i = 0; i < 15; i++) {
try {
_tap = Ipop.Tap.TapDevice.GetTapDevice(device_name);
break;
} catch {}
Thread.Sleep(2);
ProtocolLog.WriteIf(ProtocolLog.Exceptions,
"Unable to set up the tap, trying again...");
}
if(_tap == null) {
ProtocolLog.WriteIf(ProtocolLog.Exceptions, "Unable to set up the tap.");
Environment.Exit(1);
}
Address = _tap.Address;
_running = true;
_read_thread = new Thread(ReadLoop);
_read_thread.IsBackground = true;
_read_thread.Start();
}