简体   繁体   English

GCDAsyncUdpSocket + Bonjour? (bynamic udp端口)

[英]GCDAsyncUdpSocket + Bonjour? (bynamic udp port)

I'm using GCDAsyncUdpSocket for my project, I can bind a port this way, (Server part) 我正在为我的项目使用GCDAsyncUdpSocket ,我可以用这种方式绑定端口, (服务器部分)

[udpSocket bindToPort:45678 error:&error];

But I don't want to give a static port number for this. 但是我不想为此提供一个静态端口号。 How to get available free ports for UDP communication ? 如何获得可用的免费端口进行UDP通信? I am going to publish it as a service using Bonjour ? 我将使用Bonjour将其发布为服务吗? Am I on the right track ? 我在正确的轨道上吗?

Take a look at this well-done tutorial -- I did and have a product on the store that uses Bonjour because of this tutorial! 看看这个做得很好的教程-因为这个教程,我确实做了,并且在商店中有一个使用Bonjour的产品!

Tutorial: Networking and Bonjour on iPhone 教程:iPhone上的网络和Bonjour

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM