if ($self->Bind()) { while ($self->ClientSocket($self->Accept())) { $self->ClientSocket->autoflush(1); my $pid; if (!defined($pid = fork())) { $self->LogError("Fork failed: ".$!); } # Child process elsif ($pid == 0) { while ($self->ClientSocket->connected) { $self->LogComment("[".$self->ClientSocket->opened."][".defined($self->ClientSocket->connected)."][".defined($self->ClientSocket)."]"); sleep(5); } # Close the socket connection when the client goes away close($self->ClientSocket); exit 0; } # Parent process else { # Close the socket with the client close($self->ClientSocket); } } } #### [1][1][1] [1][1][1] [1][1][1] [1][1][1] etc...