public function serve()
    {
        $this->transport_->listen();

        while (!$this->stop_) {
            try {
                $transport = $this->transport_->accept();

                if ($transport != null) {
                    $pid = pcntl_fork();

                    if ($pid > 0) {
                        $this->handleParent($transport, $pid);
                    } elseif ($pid === 0) {
                        $this->handleChild($transport);
                    } else {
                        throw new TException('Failed to fork');
                    }
                }
            } catch (TTransportException $e) {
            }

            $this->collectChildren();
        }
    }
public function serve()
    {
        $this->transport_->listen();

        while (!$this->stop_) {
            try {
                $transport = $this->transport_->accept();

                if ($transport != null) {
                    $pid = pcntl_fork();

                    if ($pid > 0) {
                        $this->handleParent($transport, $pid);
                    } elseif ($pid === 0) {
                        $this->handleChild($transport);
                    } else {
                        throw new TException('Failed to fork');
                    }
                }
            } catch (TTransportException $e) {
            }

            $this->collectChildren();
        }
    }
public function serve ( ) { $ this -> transport_ -> listen ( ) ; while ( ! $ this -> stop_ ) { try { $ transport = $ this -> transport_ -> accept ( ) ; if ( $ transport != null ) { $ pid = pcntl_fork ( ) ; if ( $ pid > 0 ) { $ this -> handleParent ( $ transport , $ pid ) ; } elseif ( $ pid === 0 ) { $ this -> handleChild ( $ transport ) ; } else { throw new TException ( 'Failed to fork' ) ; } } } catch ( TTransportException $ e ) { } $ this -> collectChildren ( ) ; } }
Listens for new client using the supplied
transport. We fork when a new connection
arrives.

@return void
Listens for new client using the supplied transport . We fork when a new connection arrives .