Vote for the best protocol for the given scenario

后端 未结 9 2205
时光取名叫无心
时光取名叫无心 2021-02-08 22:04

I have a design decision to make. I need your advice.

Requirements:

  • A server and a client. client is typically a mobile phone.
  • Connected through t
9条回答
  •  星月不相逢
    2021-02-08 22:40

    Sounds like to me that you would be best served by the HTTP protocol. It has a low overhead, already well accepted. Uses TCP [which is a requirement for mobile communication], it has session negotiation [well connection wise not the actual state of the session]

    Use a different protocol for sharing of video and audio, but set the connection up with the http one.

    Using SOAP/web services would not be optimal, due to the processing required. From personal experince webservice clients on mobile machines is easier but the processing required is tremedious and can create a bottleneck in your application. [Mobile machines don't handle threads too well]

    Also: Since you are sending data over wireless you also have to account for the additional issues dealing with unguided media.

    Your requirements:

    • A server and a client. client is typically a mobile phone. : Yep
    • Connected through the Internet. : Yep, depends on how your device network is setup
    • Server and client want to talk to each other. : Yep
    • Exchange of text, multimedia between the client and the server. : HTTP works well with text and images, but you need to switch to something unreliable like UDP for video.
    • Text would be some standard format. that is predecided. : Yep
    • Real time requirements : This is impossible, but can be attempted.
    • Session would typically last for 5-15 minutes. In some cases for under a minute. assume 5 minutes as the session duration.: There are headers to keep the session open
    • The protocol should adhere to standards. : RFC Something
    • It must be efficient. : The only processing you have to do is line by line parsing of Key: data.

    Also, I forgot to mention SOAP/Webservices is XML over HTTP.

提交回复
热议问题