BACnet.IP.UDPAsyncServer.UDPAsyncServer C# (CSharp) Method

UDPAsyncServer() public method

Constructs a new UDPAsyncServer instance
public UDPAsyncServer ( IPEndPoint ep, DatagramReceivedDelegate receiveDelegate ) : System
ep System.Net.IPEndPoint The IP endpoint to bind to
receiveDelegate DatagramReceivedDelegate Callback to user code whenever a datagram is received
return System
        public UDPAsyncServer(IPEndPoint ep, DatagramReceivedDelegate receiveDelegate)
        {
            _socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
            _socket.Bind(ep);
            _receiveCallback = new AsyncCallback(_receiveComplete);
            _sendCallback = new AsyncCallback(_sendComplete);
            _receiveDelegate = receiveDelegate;
            _receiveNext();
        }