Tom Allison am Samstag, 18. Februar 2006 21.27:
> I am trying to set up a server using Net::Server.
> Mostly this is out of curiousity more than anything else.
> But following the man pages I got stuck.
>
> I was trying to set up a server to connect to port 8081,
> but none of the configuration options I've put in below appear in the file
> I'm running.

Ok, since nobody else answered... I didn't have a thorough look at the module. 
Maybe my ideas help, but I doubt it a bit:


What about

package  Net::Server::AuthServer;

?

> use strict;
> use warnings;
> use Net::Server;
> use Data::Dumper;
> use vars [EMAIL PROTECTED];
> @ISA = qw[Net::Server];
>
> my $server = bless {
>    port            => '8081',
>    log_level       => '4',
>    reverse_lookups => '1',
>    pid_file        => '/var/run/net_test.pid',
>    listen          => '16',
>    user            => 'nobody',
>    group           => 'nobody',
> }, 'AuthServer';

}, 'Net::Server::AuthServer';

?

> print Dumper($server);
>
> $server->run();
>
> ##############################
>
> The output shows up as:
>
> [EMAIL PROTECTED]:~$ perl -w -T net_test.pl
> $VAR1 = bless( {
>                   'group' => 'nobody',
>                   'pid_file' => '/var/run/net_test.pid',
>                   'listen' => '16',
>                   'log_level' => '4',
>                   'reverse_lookups' => '1',
>                   'user' => 'nobody',
>                   'port' => '8081'
>                 }, 'AuthServer' );

This is ok, since you dump from the actual namespace a variable defined in the 
same namespace.


Did you have a look into the source code of the provided subclasses of 
Net::Server (Net::Server::PreforkSimple etc.).
This may help.

hth,
Hans

> 2006/02/18-15:22:15 AuthServer (type Net::Server) starting! pid(5506)
> Port Not Defined.  Defaulting to '20203'
> Binding to TCP port 20203 on host *
> Group Not Defined.  Defaulting to EGID '1000 1000 44 40 29 25 24 20'
> User Not Defined.  Defaulting to EUID '1000'
>
> #########################
>
> It's pretty clear that it's not really taking any queues from me.
> I'm just taking my queues from the man pages.
> Should I take my queues from someplace else?

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to