0

I have an iOS app that establish a peer-to-peer connection through Bonjour/NSNetService. (based on the WiTap sample code)

In some cases, both devices won’t receive data anymore after a few seconds while they are still able to write data out (i.e. without an error being reported).

The data written to the NSOutputStream never makes it to the NSInputStream of the other side.

The strange part is that sending and receiving works right after the connection is established. It seems to go bad after a few seconds.

If I set includesPeerToPeer = false it is not happening anymore. Does anyone having the same issue? I need to use peer to peer because is required to use bluetooth.

Thanks

Pablo Martinez
  • 1,573
  • 12
  • 31

1 Answers1

0

My first guess would be that you're writing data to the stream before you get a stream event telling you that it is ready to accept more data.

If that isn't the problem, then either it's a bug in your code (which you haven't posted any of) or... well, it is possible that the class in question still doesn't work correctly. See:

https://developer.apple.com/library/ios/qa/qa1546/_index.html

If that's the case, you might have to drop down to Core Foundation briefly.

dgatwood
  • 10,129
  • 1
  • 28
  • 49