accept


Description:

[ CCode ( cname = "FCGX_Accept" ) ]
public int accept (out Stream @in, out Stream @out, out Stream err, out parameters envp)

Accept a new request

NOT thread-safe.

Finishes the request accepted by (and frees any storage allocated by) the previous call. Creates input, output, and error streams and assigns them to in, out, and err respectively. Creates a parameters data structure and assigns it to envp.

DO NOT retain pointers to the envp array or any strings contained in it, since these will be freed by the next call or a call to finish.

Code is generally of this form:

Stream @in;
Stream @out;
Stream @err;
unowned parameters envp;
while(accept(out @in, out @out, out @err, out envp) == 0) {
// Process request, writing output to @out.
finish();
}

Returns:

0 for successful call, -1 for error.


Namespace: FastCGI
Package: fcgi