Skip to content

Close client connection, but do the chores before service the next request #1062

Answered by lezhnev74
lezhnev74 asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, I guess this loop is exactly for that purpose.

while (true) {
    $request = $psr7->waitRequest();
    $psr7->respond(new Psr7\Response(200, [], 'Hello RoadRunner!'));

   // clean up here <---------------
}

I am thinking how the client knows that there is nothing else to receive? Will $psr7->respond(...) be enough and client won't exxpect any extra payload?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@rustatian
Comment options

@rustatian
Comment options

Answer selected by rustatian
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
R-question Question P-FCGI Plugin: Fast CGI
2 participants