The listener: contructor 

sub new {
    my($class, %opt) = @_;

    _save_pid();

    my $listener = IO::Socket::INET->new(
        LocalAddr => "localhost:$opt{port}",
        ReuseAddr => 1,
        Proto     => 'tcp',
        Listen    => 5,
    ) or die "Unable to listen on port 'localhost:$opt{port}': $!";

    return bless {
        _listener => $listener,
        _selector => IO::Select->new($listener),
        _options  => \%opt,
    }, $class;
}