M
M
Maxim Barulin2012-10-05 07:44:39
PHP
Maxim Barulin, 2012-10-05 07:44:39

Ajax & sockets startup problem?

Good day.
Wrote a socket server and a client in php. Everything is great, everything works ... until I try to start the server with ajax. If the server is already running, then requests to it pass without problems. If I try to start it from the browser, then the first request freezes (which, by the way, is logical, since it will not wait for the server's response), so I forcibly terminate it, but when the client is called, it also freezes. If you stop the server, then the client request will be executed, but, of course, will not return anything. I solved the problem by starting the server in a separate thread via stream_socket_client (), but I would like to know why the client request goes into vacuum, while the server is running, as can be seen from the logs. I suspect that the matter is in the queue for the execution of requests by the server (apache).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vyacheslav Plisko, 2012-10-05
@Slavenin999

session_write_close?

M
Maxim Barulin, 2012-10-05
@Slavenin999

Yes, that's exactly what I need, thanks for the reply.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question