I guess what I'm not sure about is, if I put the DBI->connect() call before process_request() then will it still be part of the child, or will it belong to the parent?
use base qw(Net::Server::PreFork); MyPackage->new({conf_file => '/home/aaron/serv.conf',})->run; //does $dbh belong to the parent? $dbh = DBI->connect("DBI:mysql:$DSN", $user, $password); sub process_request { //do child stuff here }
As for why I chose to use Net::Server, it seemed easy and reliable. And it is so far. This is my first issue with it directly and I'm nearly done with my app. I'm just trying to make things more efficient, like not having to establish a database connection for each socket connection. I want the sockets to come and go, while I maintain a single DB connection per process.
In reply to Re^2: Net::Server and DBI
by alager
in thread Net::Server and DBI
by alager
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |