NAME

PAGI::Server::Connection - Per-connection state machine

SYNOPSIS

# Internal use by PAGI::Server
my $conn = PAGI::Server::Connection->new(
    stream     => $stream,
    app        => $app,
    protocol   => $protocol,
    server     => $server,
    extensions => {},
);
$conn->start;

DESCRIPTION

PAGI::Server::Connection manages the state machine for a single client connection. It handles:

  • Request parsing via Protocol::HTTP1

  • Scope creation for the application

  • Event queue management for $receive and $send

  • Protocol upgrades (WebSocket)

  • Connection lifecycle and cleanup

Sendfile Timeout Configuration

When using sendfile() for large file transfers, the socket buffer may fill up faster than the client can drain it. The sendfile_timeout parameter controls how long to wait for the socket to become writable before giving up.

Default: 30 seconds

Configure via the sendfile_timeout parameter in PAGI::Server or directly in the Connection constructor.

SEE ALSO

PAGI::Server, PAGI::Server::Protocol::HTTP1

AUTHOR

John Napiorkowski <jjnapiork@cpan.org>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.