Hello! The chat itself took on Habré, here https://habrahabr.ru/post/209864/ Here is the demo for the chat: http://sharoid.ru/chat.html
Put on a local server, everything works. But there was a problem with the hosting. I log in via ssh to the server and run the socket server logic file with the php server.php command and then go to the client page and see the lines:
system: please wait, I try to connect to the server.
system: connection is open
Connection established successfully. But when I try to send a message, nothing happens. Tell me which way to look.
\r\n. At the same time, both the client and the server must process the packages in the same way - otherwise, the hang of one of them or both is guaranteed. If you do not want to suffer - use the library of the finished protocol, for example http, or download the library of the already finished chat. Sockets seem to be simple, but incomplete understanding of how they work - causes hangs - nick_n_a