问个关于UDP断口处理的问题
namespace Microsoft.Rfid.Reader.Driver.Acme
{
internal class UdpTransport
{
private UdpClient client;
private UdpClient asynClient;
private ILogger logger;
private AcmeReaderLayer readerLayer;
private ManualResetEvent asynEvent;
private const int clientPort = 4567;
private const int asynClientPort = 4568;
private static string localHost = Dns.GetHostName();
private Thread asynReceiveThread;
private string host;
private int port;
public UdpTransport()
{
}
public void Init(TcpTransportSettings settings,ILogger logger, AcmeReaderLayer readerLayer)
{
lock (this)
{
try
{
this.logger = logger;
this.readerLayer = readerLayer;
this.host = settings.Host;
this.port = settings.Port;
asynEvent = new ManualResetEvent(true);
IPAddress ip = Dns.GetHostAddresses(localHost)[0];