iPhone'dan bir UDP yayını göndermem ve ardından bir zaman aşımı süresiyle UDP yanıtı dinlemem gerekiyor. Apple'ın UDPEcho example'u buldum ama ihtiyacım olan şey olup olmadığından emin değilim. Ayrıca göndermek, ancak almak için this example bulundu.iPhone UDP yayını ve yanıtı
//send the broadcast
SendUDP("255.255.255.255", targetPort, myData);
//A blocking call to get the data. Timeout value will be short, 2 seconds at most
//An asynchronous option is ok, if it's necessary.
Response = GetFirstUDPResponse(receptionPort, timeoutValue);
//process the response
if(Response == null)
//we timed out
else
//process response
ben tekerleği yeniden icat gerekmez, basit bir çözüm için umut ediyorum: Temelde, böyle basit bir şey yapmak gerekir. Bunu uygulamak için en iyi stratejiyle ilgili her türlü tavsiyeyi takdir ediyorum!
Teşekkürler, kolaydı. Kodumun çoğunu burada sağladım: http://stackoverflow.com/questions/5790149/little-problem-with-asyncudpsocket-receiving-data-after-connecting-to-broadcast-i/7682688#7682688 – Alex