I don't work with classes and methods... I don't know how to use it.
Can someone help me on this? I need a straigthforward way (if possible) to receive udp data.
We can go around and around in circles for days. You cant blindly brute force an API to work the way you want. There are standard processes required to work though these problems. The first... Is to verify that the example is working.
1) Have you successfully compiled and tested the example? If yes...
2) Do you understand the example? If no, then play with the code and read the LNet classes until you do, then goto (2)
3) If yes, split the example into two separate projects for client/server.
4) If your hacking fails, return to step 2
It looks like you want the API to match your desired "style of coding" rather than accept the API must be used in a certain way.
Personally, I use Indy since I've been using that for almost 20 years. But, I can tell you, LNet is not a low Unix networking API.
Follow the example!