In first approach I create client-server app ,based on sampleProject , which send some data to server.
Legend:
sender
address = reciver ip
port = re
Multicast addresses are special reserved addresses for multicasting purpose. When a host send a data to a multicast address (group), all hosts that have joined that group will receive the data.
Any host that wishes to receive data from a multicast group needs to join that group. The three steps for GCDAsyncUdpSocket are: (note that group address and group port combination must be unique for that selected multicast group)
[_udpSocket bindToPort:_port error:&error];
[_udpSocket joinMulticastGroup:_address error:&error];
[_udpSocket beginReceiving:&error])
For a sender, you don't need these two lines as you have.
[_udpSocket bindToPort:0 error:&error]; //bindToPort:0 is same as auto-select sender port by default.
[_udpSocket beginReceiving:&error]; //if you don't want to received, no need for this.
Use the 239.0.0.0-239.255.255.255 for your private local network. Avoid 224... You can read more from the link above.