NAME
SCGI
DESCRIPTION
This module is for implementing an SCGI interface for an application server.
SYNOPISIS
use SCGI;
use IO::Socket;
my $socket = IO::Socket::INET->new(Listen => 5, ReuseAddr => 1, LocalPort => 8080)
or die "cannot bind to port 8080: $!";
my $scgi = SCGI->new($socket);
while (my $request = $scgi->accept) {
$request->read_env;
read $request->connection, my $body, $request->env->{CONTENT_LENGTH};
print $request->connection "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\n\r\nHello!\n";
}
public methods
- new
-
Takes a socket and returns a new SCGI listener.
- accept
-
Accepts a connection from the socket and returns an
SCGI::Request
for it. - socket
-
Returns the socket that was passed to the constructor.
- blocking
-
Returns true if socket should block.
AUTHOR
Thomas Yandell mailto:tom+scgi@vipercode.com
COPYRIGHT
Copyright 2005 Viper Code Limited. All rights reserved.
LICENSE
This file is part of SCGI (perl SCGI library).
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.