1FCGI(3)               User Contributed Perl Documentation              FCGI(3)
2
3
4

NAME

6       FCGI - Fast CGI module
7

SYNOPSIS

9           use FCGI;
10
11           my $count = 0;
12           my $request = FCGI::Request();
13
14           while($request->Accept() >= 0) {
15               print("Content-type: text/html\r\n\r\n", ++$count);
16           }
17

DESCRIPTION

19       Functions:
20
21       FCGI::Request
22           Creates a request handle. It has the following optional parameters:
23
24           input perl file handle (default: \*STDIN)
25           output perl file handle (default: \*STDOUT)
26           error perl file handle (default: \*STDERR)
27                   These filehandles will be setup to act as
28                   input/output/error on successful Accept.
29
30           environment hash reference (default: \%ENV)
31                   The hash will be populated with the environment.
32
33           socket (default: 0)
34                   Socket to communicate with the server.  Can be the result
35                   of the OpenSocket function.  For the moment, it's the file
36                   descriptor of the socket that should be passed. This may
37                   change in the future.
38
39                   You should only use your own socket if your program is not
40                   started by a process manager such as mod_fastcgi (except
41                   for the FastCgiExternalServer case) or cgi-fcgi.  If you
42                   use the option, you have to let your FastCGI server know
43                   which port (and possibly server) your program is listening
44                   on.  See remote.pl for an example.
45
46           flags (default: 0)
47                   Possible values:
48
49                   FCGI::FAIL_ACCEPT_ON_INTR
50                               If set, Accept will fail if interrupted.  It
51                               not set, it will just keep on waiting.
52
53           Example usage:
54               my $req = FCGI::Request;
55
56           or:
57               my %env;
58               my $in = new IO::Handle;
59               my $out = new IO::Handle;
60               my $err = new IO::Handle;
61               my $req = FCGI::Request($in, $out, $err, \%env);
62
63       FCGI::OpenSocket(path, backlog)
64           Creates a socket suitable to use as an argument to Request.
65
66           path    Pathname of socket or colon followed by local tcp port.
67                   Note that some systems take file permissions into account
68                   on Unix domain sockets, so you'll have to make sure that
69                   the server can write to the created file, by changing the
70                   umask before the call and/or changing permissions and/or
71                   group of the file afterwards.
72
73           backlog Maximum length of the queue of pending connections.  If a
74                   connection request arrives with the queue full the client
75                   may receive an  error  with  an  indication of
76                   ECONNREFUSED.
77
78       FCGI::CloseSocket(socket)
79           Close a socket opened with OpenSocket.
80
81       $req->Accept()
82           Accepts a connection on $req, attaching the filehandles and
83           populating the environment hash.  Returns 0 on success.  If a
84           connection has been accepted before, the old one will be finished
85           first.
86
87           Note that unlike with the old interface, no die and warn handlers
88           are installed by default. This means that if you are not running an
89           sfio enabled perl, any warn or die message will not end up in the
90           server's log by default.  It is advised you set up die and warn
91           handlers yourself.  FCGI.pm contains an example of die and warn
92           handlers.
93
94       $req->Finish()
95           Finishes accepted connection.  Also detaches filehandles.
96
97       $req->Flush()
98           Flushes accepted connection.
99
100       $req->Detach()
101           Temporarily detaches filehandles on an accepted connection.
102
103       $req->Attach()
104           Re-attaches filehandles on an accepted connection.
105
106       $req->LastCall()
107           Tells the library not to accept any more requests on this handle.
108           It should be safe to call this method from signal handlers.
109
110           Note that this method is still experimental and everything about
111           it, including its name, is subject to change.
112
113       $env = $req->GetEnvironment()
114           Returns the environment parameter passed to FCGI::Request.
115
116       ($in, $out, $err) = $req->GetHandles()
117           Returns the file handle parameters passed to FCGI::Request.
118
119       $isfcgi = $req->IsFastCGI()
120           Returns whether or not the program was run as a FastCGI.
121

LIMITATIONS

123       FCGI.pm isn't Unicode aware, only characters within the range 0x00-0xFF
124       are supported. Attempts to output strings containing characters above
125       0xFF results in a exception: (F) "Wide character in %s".
126
127       Users who wants the previous (FCGI.pm <= 0.68) incorrect behavior can
128       disable the exception by using the "bytes" pragma.
129
130           {
131               use bytes;
132               print "\x{263A}";
133           }
134

AUTHOR

136       Sven Verdoolaege <skimo@kotnet.org>
137
139       This software is copyrighted (c) 1996 by by Open Market, Inc.
140
141       See the LICENSE file in this distribution for information on usage and
142       redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
143
144
145
146perl v5.28.1                      2016-03-07                           FCGI(3)
Impressum