iOS client-server app: HTTP or TCP/IP?

后端 未结 5 448
栀梦
栀梦 2021-02-02 02:48

I am about to start designing/developing a client-server iOS app. I am leaning towards using HTTP requests to get/post data from/to a server, but want to make sure this is the r

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-02 03:28

    He means that when using HTTP you will need to send the HTTP protocol request verb (GET, POST etc) and in general obey the HTTP rules. When using sockets you are free to send whatever you want and nothing else.
    To answer your question we would need to know more about your application. Here are some rules I'd stick to:

    1. game - tcp
    2. anything real time - tcp
    3. database frontend (CRUD operations on data), social networking, non real-time gaming -- http/restful services/json
    4. database frontend which you want to expose as an API to enterprise customers -- consider SOAP

提交回复
热议问题