Error resolving a NSNetService
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:didN开发者_开发百科otResolve: 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!
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!
Before [service resolveWithTimeout:] call [service stop]
精彩评论