Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-03

TProcess FastCGI

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Micha Nelissen

Hi,

Is TProcess capable of the following ("boot" requirements for FastCGI process) ?

http://fastcgi.com/devkit/doc/fcgi-spec.html#S2

" 2.2 File descriptors

The Web server leaves a single file descriptor, FCGI_LISTENSOCK_FILENO, open when the application begins execution. This descriptor refers to a listening socket created by the Web server.

FCGI_LISTENSOCK_FILENO equals STDIN_FILENO. The standard descriptors STDOUT_FILENO and STDERR_FILENO are closed when the application begins execution. A reliable method for an application to determine whether it was invoked using CGI or FastCGI is to call getpeername (FCGI_LISTENSOCK_FILENO), which returns -1 with errno set to ENOTCONN for a FastCGI application.

The Web server's choice of reliable transport, Unix stream pipes (AF_UNIX) or TCP/IP (AF_INET), is implicit in the internal state of the FCGI_LISTENSOCK_FILENO socket. "

Micha

Reply by email

Michael Van Canneyt
to Micha Nelissen
Micha Nelissen wrote 23 lines
Hi, Is TProcess capable of the following ("boot" requirements for FastCGI process) ? http://fastcgi.com/devkit/doc/fcgi-spec.html#S2 " 2.2 File descriptors The Web server leaves a single file descriptor, FCGI_LISTENSOCK_FILENO, open when the application begins execution. This descriptor refers to a listening socket created by the Web server. FCGI_LISTENSOCK_FILENO equals STDIN_FILENO. The standard descriptors STDOUT_FILENO and STDERR_FILENO are closed when the application begins execution. A reliable method for an application to determine whether it was invoked using CGI or FastCGI is to call getpeername (FCGI_LISTENSOCK_FILENO), which returns -1 with errno set to ENOTCONN for a FastCGI application. The Web server's choice of reliable transport, Unix stream pipes (AF_UNIX) or TCP/IP (AF_INET), is implicit in the internal state of the FCGI_LISTENSOCK_FILENO socket. "

No, it is not. It creates pipes for stdin/stdout, not a socket.

Michael.

Reply by email

Michael Van Canneyt
to Micha Nelissen
Micha Nelissen wrote 6 lines
On Thu, 30 Mar 2006 09:27:02 +0200 (Romance Daylight Time) Michael Van Canneyt wrote: > No, it is not. It creates pipes for stdin/stdout, not a socket. Doh! How to extend TProcess so it can ?

You would have to be able to assign the input/output streams.

Michael.

Reply by email