On Sat, Apr 17, 2010 at 8:07 PM, Jens Alfke <
je...@mooseyard.com>
wrote:
>
> On Apr 17, 2010, at 5:51 AM, HB wrote:
>
>> I'm using MYNetwork in a small game and I was delighted to find that
>> MYNetwork also works using bluetooth conections :-)
>
> Um … it does?! That’s news to me — I never put in any code to handle Bluetooth. o_O
>
> Is this on iPhone? The only thing I can imagine is that Apple modified the Bonjour implementation to do service discovery over Bluetooth, and made -[NSNetService getInputStream:outputStream:] create Bluetooth sockets instead of TCP ones. Huh. I’m pretty sure that’s not documented anywhere.
>
> That’s good to hear, since it makes it more useful on iPhone in the absence of a nearby WiFi base station.
>
I'v looked through the documentation and the only reference I've found
is the readme of the "WiTap" example application.
http://developer.apple.com/iphone/library/samplecode/WiTap/Listings/ReadMe_txt.html
I didn't think that this readme file is the definitive reference, but
there you are ...
>> Now I'm looking
>> for ways to improve the stability of the connection. I'm thinking
>> about a fixed number of reconnection tries if the connection uses
>> bluetooth or something like that.
>
> What are the specific stability problems you’re seeing?
Hard to reproduce that at the moment because the trial happened at the
local pub using a friends iPhone. But my guess is that
- (void)connectionDidClose:(TCPConnection *)connection got called when
we increased the distance between the devices. Which can happen quite
easily if one user moves around the room etc. So I'm looking for an
automatic reconnection try. Is there a "best practive" to achieve
this? Is there a way to distinguish between deliberately closed
connections and accidentally closed connections? At the moment I
thinking about treating every closed connection as an accident if it
wasn't preceded by "willCloseConnection"-message.
HB