Clearquest

 view release on metacpan or  search on metacpan

lib/Clearquest/DBService.pm  view on Meta::CPAN

      if ($childpid) {
        $self->{pid} = $$;

        $SIG{CHLD} = \&_funeral;
        $SIG{HUP}  = \&_endServer;
        $SIG{USR2} = \&_restartServer;

        $self->_debug ("Parent produced child [$childpid]");
      } else {

        # In child process - ServiceClient
        $self->{pid} = $$;

        $self->_debug         ("Calling _serviceClient");
        $self->_serviceClient ($host, $client);
        $self->_debug         ("Returned from _serviceClient - exiting...");

        exit;
      }    # if
    } else {
      $self->_serviceClient ($host, $client);
    }    # if
  }    # while

  # This works but I really don't like it. The parent should have looped back to
  # the while statement thus waiting for the next client. But it doesn't seem to
  # do that. Instead, when multithreaded, the child exits above and then the
  # parent breaks out of the while loop. I'm not sure why this is happening.
  # This goto fixes this up but it's sooooo ugly!
  goto LOOP;
}    # startServer

1;

=pod

=head1 CONFIGURATION AND ENVIRONMENT

DEBUG: If set then $debug is set to this level.

VERBOSE: If set then $verbose is set to this level.

TRACE: If set then $trace is set to this level.

=head1 DEPENDENCIES

=head2 Perl Modules

L<Carp>

L<File::Basename|File::Basename>

L<FindBin>

L<IO::Socket|IO::Socket>

L<Net::hostent|Net::hostent>

L<POSIX>

=head1 BUGS AND LIMITATIONS

There are no known bugs in this module.

Please report problems to Andrew DeFaria <Andrew@DeFaria.com>.

=head1 LICENSE AND COPYRIGHT

Copyright (C) 2007-2026 Andrew DeFaria <Andrew@DeFaria.com>

This program is free software; you can redistribute it and/or modify it
under the terms of the the Artistic License (2.0). You may obtain a
copy of the full license at:

L<http://www.perlfoundation.org/artistic_license_2_0>

Any use, modification, and distribution of the Standard or Modified
Versions is governed by this Artistic License. By using, modifying or
distributing the Package, you accept this license. Do not use, modify,
or distribute the Package, if you do not accept this license.

If your Modified Version has been derived from a Modified Version made
by someone else, you are strictly prohibited from removing any
copyright notice from that Modified Version.

Copyright Holder makes no, and expressly disclaims any, representation
or warranty, should the Package be used for any purpose.  The liability
of the Copyright Holder is limited to the maximum extent permitted by
law.

=cut



( run in 2.070 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )