Do I understand correctly that modern instant messengers (iOS / Android clients) keep a constant connection with the server, otherwise how does the message sent from client A instantly arrive at client B?

If so, then it turns out the servers are working in the Daemon form (it seems so called), that is, the cycle is constantly spinning in which a new request from an established client is received at the expense of sockets, for example, and does the logic run?

Of course this is an abstract description, more interested in the concept itself applicable to PHP. Usually the server accepts the http request, the application implements the request logic and responds. This is how the site works. And how to implement on the same server additionally the implementation of a permanent connection with the client using sockets?

  • HTTP Long Polling - Suvitruf
  • @Suvitruf But what about websocket? - rugleb
  • I just called one of the possible options) - Suvitruf

0