How to Connect multiple peers on the iPhone Application over WiFi?

后端 未结 2 538
遇见更好的自我
遇见更好的自我 2021-02-10 23:28

I have an idea for an ios(iPhone) application to which requires connecting to several peers. I am basing my code on the WiTab (SampleCode-developer.apple.com) example.

2条回答
  •  说谎
    说谎 (楼主)
    2021-02-10 23:52

    Its pretty hard to modify the Apple.Developer Witap application because you need to hold all the resolved adresses , have to modify all the methods and handle lot.

    I think this tutorial will achieve your goal.

    The app is called “Chatty.” Its source code is located here

    Download the App --> Open --> Click-on Chatti project tab --> Build Settings --> Change the base SDK to iOS6

    it is being released under the MIT license, which means that you are free to modify and reuse it at will

    In this tutorial, They are going to explore a simple chat application for the iPhone. It allows you to host your own chat room and advertise it on your local Wi-Fi network (in which case your app acts as a chat “server”) or find and join chat rooms hosted by other people on your network (acting as a chat “client”). Both announcement and discovery of chat rooms are implemented using Apple’s Bonjour protocol same as Witap Application

    Now I'm answering your each questions

    Is it possible to connect more than one device simultaneously over WiFi?

    YES, You can

    If yes,What is the maximum number of device that can be connected in same pattern?

    I think you can pair with any number of devices

    Which type of CFSocket is useful for multiple Connection(TCP/UDP)?

    My suggestion is TCP

    The remaining answers for your questions can be easily understand from the sample Chatty App :)

    Note: The server and clients need to be on the same WiFi network

提交回复
热议问题