FCGI::...ection(3pm)

✨ NAME ✨

okay so welcome to FCGI::Client::Connection β€” a Perl module (yes, from the User Contributed Perl Documentation corner of the universe 🫢) and it's literally just connection to FastCGI server. that's the whole vibe. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

this module handles the connection to a FastCGI server. that's it, that's the job, and it does it. slay.


πŸŽ€ ATTRIBUTES πŸŽ€

  • sock β€” the socket object. the actual little wire goblin doing the talking πŸ‘‘
  • timeout β€” a read only integer value, and the default is 10 seconds ⏰ (so if your server ghosts you, this is how long you wait before giving up πŸ’€)

🌸 METHODS 🌸

my ($stdout, $stderr, $appstatus) = $self->request($env, $content)

here's the main character method, bestie ✨ and look at that signature, it's giving everything:

my ($stdout, $stderr, $appstatus) = $self->request($env, $content)

so, the deets:

  • $env is the environment hash, same as CGI 🌈
  • $content is the request body string πŸ“
  • this method returns the $stdout and $stderr strings 🫢
  • when an error happens, it returns undef β€” no cap, that's the error signal 😭
  • $appstatus is the status code of the FastCGI server, and it's one of the following codes:
#define FCGI_REQUEST_COMPLETE 0
#define FCGI_CANT_MPX_CONN    1
#define FCGI_OVERLOADED       2
#define FCGI_UNKNOWN_ROLE     3

these constants are defined at FCGI::Client::Constat. periodt. πŸ’œ


🧚 FAQ 🧚

why don't support FCGI_KEEP_CONN?

okay so real talk 🫢:

  • FCGI_KEEP_CONN is not used by lighttpd's mod_fastcgi.c, and mod_fast_cgi for apache. and FCGI.xs doesn't support it either πŸ’€
  • seems FCGI_KEEP_CONN is not used in the real world. iykyk πŸ¦‹

⭐ sign-off ⭐

that's the page, bestie β€” brought to you by perl v5.42.0, dated 2018-07-17, and honestly? iconic for its time. go forth and FastCGI responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from