Is it possible to build socket connection between 2 iOS devices

前端 未结 1 1726
执笔经年
执笔经年 2021-02-06 18:47

Is it possible to build a socket connection between 2 iOS devices connected to the same network (Without net)?

if it\'s possible .. Is (CocoaAsyncSocket project) useful

1条回答
  •  不知归路
    2021-02-06 19:17

    Yes, you can do it, and yes, CocoaAsyncSocket would be useful. If you don't have to worry about the carrier network's firewalls and filters, then you should certainly be able to build a client-server app running on two iOS devices. One opens the server socket to listen, and the other one (the client) connects, via the Wi-Fi network.

    Trying searching on Google (e.g. "CocoaAsyncSocket iPhone iOS site:stackoverflow.com") or directly here on Stack Overflow.

    Here's somebody who seems to have accomplished this

    Another link

    And a post from Robbie Hanson himself, referring you to the EchoServer projects in the github repository

    EchoServer project

    You may have to use a static IP address for the server device (I'm not sure how much control you have over the Wi-Fi network's configuration), or use some other mechanism for letting the two devices discover each other.

    0 讨论(0)
提交回复
热议问题