Receive udp ios broadcast packets

I almost completely completed the work with the iOS client for the REST service. The only thing I miss is the ability for the client to listen on the network for UDP broadcasting, which receives the display host name and base URL to download. There may be several servers on the network waiting to be downloaded.

Asynchronous is preferred. Servers will be displayed to the user when the device detects them, and I want the user to be able to select a server at any given time.

The transmitter sends 255.255.255.255 and does not expect the data to return.

I am new to c lens, so it is best simple and convenient to use.

+4
source share
1 answer

I recommend looking at CocoaAsyncSocket . It can handle UDP sockets well. I have not tried listening to the broadcast with her, but this is probably the best choice.

+3
source

Source: https://habr.com/ru/post/1401054/


All Articles