Aegis.Network.UDPServer.WaitForReceive C# (CSharp) Method

WaitForReceive() private method

private WaitForReceive ( ) : void
return void
        private void WaitForReceive()
        {
            try
            {
                lock (this)
                {
                    EndPoint remoteEP = new IPEndPoint(IPAddress.Any, 0);
                    var socket = _socket;
                    socket?.BeginReceiveFrom(_receivedBuffer, 0, _receivedBuffer.Length, SocketFlags.None,
                        ref remoteEP, SocketEvent_Receive, null);
                }
            }
            catch (Exception e)
            {
                if (ExceptionRaised == null)
                    Logger.Err(LogMask.Aegis, e.ToString());
                else
                    ExceptionRaised.Invoke(e);
            }
        }