private void Initialize() { using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "Initialize")) { try { // transceiver socket for sending and receiving freeform messages IUdpSocketTransceiver socket = UdpSocketTransceiverFactory.Create(this.ExecutorService, new UdpSocketTransceiverParameter() { IPAddress = !_arg.LocalIpAddress.IsEmpty() ? _arg.LocalIpAddress : IPAddress.Any.ToString(), ListenWaitTime = 100, InterfaceIP = _arg.InterfaceIpAddress, MulticastIP = _arg.MulticastIpAddress, PortNo = _arg.ReceivePortNo, UseInternalQueue = false, }); _sockReceiver = socket; _sockTransmitter = socket; _sockReceiver.DataReceived += new UdpSocketReceivedDataHandler(OnReceiveUdpEntityFromSocket); _sockReceiver.Start(); method.Info("Initialize (Success)"); } catch (Exception ex) { method.Exception(ex); } } }
public SocketTransceiver(IExecutorService executorService, string ipAddress, int portNo) { IUdpSocketTransceiver socket = UdpSocketTransceiverFactory.Create(executorService, new UdpSocketTransceiverParameter() { IPAddress = ipAddress, ListenWaitTime = 100, PortNo = portNo, UseInternalQueue = false, }); _sockReceiver = socket; _sockTransmitter = socket; _sockReceiver.DataReceived += new UdpSocketReceivedDataHandler(OnReceiveUdpEntityFromSocket); Current = this; }