UDP Listener not getting messages

I am trying to create a UDP listener but I do not seem to be getting any messages and I am not sure what step I am missing

UNetworkManager* UNetworkManager::ConstructNetworkManager(const FString& Description, const FString& UDPSocketName,
    const FString& TheIP, const int32 ThePort, const int32 BufferSize,
    const bool AllowBroadcast, const bool Bound, const bool Reusable,
    const bool Blocking)
{
    UNetworkManager* wrapper = Constructor();

    wrapper->SocketSubsystem = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM);
    FIPv4Address::Parse(TheIP, wrapper->RemoteAdress);

    wrapper->RemoteEndPoint = FIPv4Endpoint(wrapper->RemoteAdress, ThePort);

    // First set our socket null
    wrapper->UDPSocket = nullptr;
    UE_LOG(LogTemp, Warning, TEXT("ConstructNetworkManager step 1"));
    if (wrapper->SocketSubsystem != nullptr) // If socket subsytem is good
    {
        UE_LOG(LogTemp, Warning, TEXT("ConstructNetworkManager step 2"));
        wrapper->UDPSocket = wrapper->SocketSubsystem->CreateSocket(NAME_DGram, *Description, true);

        if (wrapper->UDPSocket != nullptr) // Is our socket created
        {
            UE_LOG(LogTemp, Warning, TEXT("ConstructNetworkManager step 3"));
            // Setup the socket 
            bool Error = !wrapper->UDPSocket->SetNonBlocking(!Blocking) ||
                !wrapper->UDPSocket->SetReuseAddr(Reusable) ||
                !wrapper->UDPSocket->SetBroadcast(AllowBroadcast) ||
                !wrapper->UDPSocket->SetRecvErr();

            if (!Error)
            {
                UE_LOG(LogTemp, Warning, TEXT("ConstructNetworkManager step 4"));
                if (Bound)
                {
                    Error = !wrapper->UDPSocket->Bind(*wrapper->RemoteEndPoint.ToInternetAddr());
                }
            }

            if (!Error)
            {
                UE_LOG(LogTemp, Warning, TEXT("ConstructNetworkManager step 5"));
                int32 OutNewSize;

                wrapper->UDPSocket->SetReceiveBufferSize(BufferSize, OutNewSize);
                wrapper->UDPSocket->SetSendBufferSize(BufferSize, OutNewSize);
                wrapper->UDPSocket->Listen(10);
            }

            if (Error)
            {
                UE_LOG(LogTemp, Warning, TEXT("ConstructNetworkManager step 6"));
                GLog->Logf(TEXT("FUdpSocketBuilder: Failed to create the socket %s as configured"), *Description);

                wrapper->SocketSubsystem->DestroySocket(wrapper->UDPSocket);
                wrapper->UDPSocket = nullptr;
            }
        }

    }


    return wrapper;
}

FString UNetworkManager::GrabWaitingMessage()
{
    uint32 Size;

    TSharedRef<FInternetAddr> Sender = SocketSubsystem->CreateInternetAddr();

    while (UDPSocket->HasPendingData(Size))
    {
        int32 Read = 0;
        //ReceivedData.Init(FMath::Min(Size, 65507u));
        ReceivedData.SetNum(Size);
        UDPSocket->RecvFrom(ReceivedData.GetData(), ReceivedData.Num(), Read, *Sender);
    }


    return StringFromBinaryArray(ReceivedData);

}

FString UNetworkManager::StringFromBinaryArray(const TArray<uint8>& BinaryArray)
{
    //Create a string from a byte array!
    const std::string cstr(reinterpret_cast<const char*>(BinaryArray.GetData()), BinaryArray.Num());

    //FString can take in the c_str() of a std::string
    return FString(cstr.c_str());
}


bool UNetworkManager::anyMessages()
{
    uint32 Size;
    if (UDPSocket != NULL && UDPSocket->HasPendingData(Size))
    {
        return true;
    }

    return false;
}

Here are the property declarations
FSocket* UDPSocket;
// Description for debugging
FString SocketDescription;

// Remote Address
FIPv4Endpoint RemoteEndPoint;
FIPv4Address RemoteAdress;

// Socket Subsystem
ISocketSubsystem* SocketSubsystem;

// The data
TArray<uint8> ReceivedData;
TArray<uint8> SendData;

I can use these setup to send UDP messages but not to recieve.

I call the factor method with 192.168.1.255, 6800, allowbroadcast true, bound false, reusable true, blocking true.
But whenever Ic all the anymessage function there is no waiting data.

Any help Is appreciated

Hi. You have to bound UDP socket to a local address to receive anything.

	// Bind socket to our port.
	LocalAddr = SocketSubsystem->GetLocalBindAddr(*GLog);
	
	LocalAddr->SetPort(bInitAsClient ? GetClientPort() : URL.Port);
	
	int32 AttemptPort = LocalAddr->GetPort();
	int32 BoundPort = SocketSubsystem->BindNextPort( Socket, *LocalAddr, MaxPortCountToTry + 1, 1 );

This code worked as is. The issue was the means I was using to send the data. The website wont allow me to delete it

bind to 0.0.0.0 to listen for broadcast messages on the default nic