Answer the question
In order to leave comments, you need to log in
Multithreading, sockets, php?
Kind.
There is a socket server in php, several clients connect to it, the order of communication is as follows:
клиент шлет серверу свой id<br/>
сервер отвечает, что id принят<br/>
клиент шлет серверу инфу<br/>
сервер отвечает, что инфа принята
cliend1id<br/>
client2id<br/>
client1data<br/>
client2data<br/>
Answer the question
In order to leave comments, you need to log in
Pay attention to the so-called "session mechanism", or at least "identifiers". Google, and even Wikipedia - both concepts.
thanks, the problem is that I didn’t find exactly the way to get the session ID
, only creating an array clientId=>socket connection resource comes to mind
For a socket server in php, you can take a specialized solution phpDaemon or nanoserv.
The last user used it himself, all users are separated by sockets and nothing gets mixed up anywhere)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question