解析 NSNetService 时出错
我正在创建一款可以通过 Wi-Fi 在 iPhone 上玩的棋盘游戏。
当设备A邀请设备B玩时(尝试解析B发布的NSNetService),设备B可以接受或拒绝。
如果 B 拒绝,A 就会收到通知,一切都会好起来。但是,如果 A 稍后尝试再次邀请 B,我会在 netService:didNotResolve: 委托方法中收到以下错误。
NSNetServicesErrorCode = -72003 NSNetServicesErrorDomain = 10
错误-72003 意味着NSNetServicesActivityInProgress...我怎样才能让一个玩家多次“邀请”其他玩家?
我正在使用 AsynchSocket 库,谢谢!
I'm creating a board game to be played via wi-fi, in the iPhone.
When device A invites device B to play(try to resolve the NSNetService published by B), device B can accept or decline.
If B declines, A is notified and everything is fine. But if A try to invite B again later, i get the following error in my netService:didNotResolve: delegate method.
NSNetServicesErrorCode = -72003
NSNetServicesErrorDomain = 10
The error -72003 means NSNetServicesActivityInProgress...How can i proceed to let one player "invite" other player more than once ?
I'm using the AsynchSocket libray, thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,我明白了。
我正在做的是在 browserDidFind: delegate 方法中尽快解析 NSNetService 。当需要连接时,我调用 [socket connectToAddress:],传递 NSNetService 地址,没有更多错误!
谢谢!
Ok, i figure that out.
What i'm doing is to resolve the NSNetService as quick as possible in the browserDidFind: delegate method. When a need to connect i call [socket connectToAddress:], passing the NSNetService address, no more errors!
thanks!
在[服务resolveWithTimeout:]调用[服务停止]之前
Before [service resolveWithTimeout:] call [service stop]