Objective-C networking - best practices?

后端 未结 5 1942
面向向阳花
面向向阳花 2020-12-29 11:22

I\'m building an Objective-C app that has both a server and a client. The client can send updates to the server, and the server needs to be able to send updates to each conn

5条回答
  •  天涯浪人
    2020-12-29 11:35

    I don't know how you plan to design you system, but usually a server cannot connect to a client; the client must initiate the communication. With a low limit of 50 clients, you may not be looking at a web-server/client-like implementation...

    That said, there are basically two ways to handle client server communication: 1. The client polls the server periodically to get updates 2. The client keeps a connection open to the server and the the server responds with a well known (as in both sides understand it) protocol.

提交回复
热议问题