F
F
foonfyrick2021-02-25 08:40:38
Android
foonfyrick, 2021-02-25 08:40:38

Difference between Socket,WebSocket,HTTP (in simple terms)?

Are there any other mechanisms for working with the server and which of them should be preferred, when and why to use, and which ones are either rarely used or not used at all?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladimir Korotenko, 2021-02-25
@foonfyrick

The socket sends a binary stream. All interaction is up to you. Web socket is the same binary serializer but with a bunch of top-level wrappers. Http is a simple text protocol. When to use http to receive data, web socket if you need a fast and stable connection. It's just that the socket is even faster, perhaps for games and all sorts of stock tickers. But consider the specifics of mobile phones, all permanent connections eat up the battery, and even the system can kill your stream at any time.

S
Sergey Gornostaev, 2021-02-25
@sergey-gornostaev

These are all network protocols of different levels of the OSI model. Did you learn the basics of networking before you started programming network applications?

D
Dr. Bacon, 2021-02-25
@bacon

in simple terms
google, and come here already with a specific question.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question