There are a few things you should consider when sending data via wifi direct
After connecting, one device will be the owner of the group, and the other client
The group owner will have a fixed IP address, i.e. 192.168.49.1
You will find out who became the owner of the group only at run time.
After connecting, you must send some data from the client to the server, which contains information about its IP address. This is because the server will not know the IP address of the client.
This way you can only send data. Because by this time you will find out which device has an IP address.
Greetings.
source share