views:

250

answers:

1

Is there any way to open a broadcast bluetooth socket, take a listen and send replies? I want a proper peer to peer system where I broadcast and listen for broadcasts in an area. That way, variable clients can mingle. Is this possible?

My theory is this: If GameKit can sit around wasting 25 seconds of the users time whilst having access to a broadcast socket, can't I? Or, must I be in kernel mode for such access?

I'm not really sure where the proper bluetooth headers are as well.

Thanks for reading!

+2  A: 

Bluetooth doesn't really have broadcast mode. The closest you can get to it is to have some protocol where one of the players becomes a master of the game, and everybody else connects to him. After that the master must rebroadcast received packets to the rest of the clients. You can build on top of that to have some shared state and make the players re-elect the master if the original one disappears.

Vlad
Seems like we have no freedom as developers. I demand raw sockets! I'm sure I could make it connect way faster than GameKit does as well. It takes a total of 40 seconds between a 3GS and 3G.
Kyle
are you connecting to the known device by mac address? Or to unknown device. Bluetooth inquiry and discovery could take up to 2 minutes. Connection to the known address should take no more then 2 seconds.
Vlad