Have questions about working with sockets using PHP:
- what does
socket_accept()
if no one is currently connected to the socket? - Does it make sense to do
sleep()
beforesocket_read()
orsocket_write()
?
Well here everything is written fine
It has been created by the appliance. Once a successful connection is made, it can be used for communication. If there are multiple connections, the first will be used. If there are no pending connections, socket_accept () will block until a connection becomes present. If socket has been made non-blocking using socket_set_blocking () or socket_set_nonblock (), FALSE will be returned.
The socket resource may be used to accept new connections. It can be reused.
And, yes, if there is anything you can choose and read Russian in your own language :)
Source: https://ru.stackoverflow.com/questions/152473/
All Articles