Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Get content of the tx UDP datagram

I am doing a UDP client program in C++/CLI. I found a good example on the web but I have a problem with a part of it. The code is the following

.....
 array<Byte>^ receiveBuffer = gcnew array<Byte>(256);
    {
        IPEndPoint^ senderEndPoint = gcnew IPEndPoint(localAddress, 0);

        Console::WriteLine("Receiving datagrams in a loop until a zero byte datagram is received...");
        while (true)

        {
            receiveBuffer = udpSocket->Receive(senderEndPoint);

            Console::WriteLine("Read {0} bytes from {1}", receiveBuffer->Length, senderEndPoint->ToString());

            if (receiveBuffer->Length == 0)
                break;
        }
    }

Everything is ok (on command window I read correctly the number of bytes tx by my server application (another application)), but I don't understand how to get the content of the tx UDP datagram. I cannot find any method which would return the content of UDP datagram. Can anybody help me?

Comments