Search code examples
ipaddevicensnetservice

iPad netservice with more devices


Heey

I want to make a netservice where more ipads can connect to at the same time.

I made a one 1 iPad open a NSNetservice and open the in- and outputstream.

I started a netservice on iPad A,

When connecting with iPad B to iPad A this just works fine. But when iPad C tries to connect the following happens: - Tries to resolve the NSNetService. - Resolves succesfull - Open input stream - Open output stream (eventCode equals NSStreamEventOpenCompleted) - End encountered

Because of the end encounters i cant connect, thats clear for me, but how do i make it work?

Is it possible to connect with more devices on the same netstream? Or do i have to make another solution?

Thanks


Solution

  • I think you have to create a new thread for each connection. At least, this worked for me when I built a message app for the iPhone. Each connection will hold the thread, and wait for a response (the thread will 'freeze').