public function listen($errorHandler = null)
    {
        if ($this->handler instanceof \Closure) {
            $this->handler = $this->handler->bindTo($this);
        }

        $response = call_user_func($this->handler, $this->request, $this->response, $errorHandler);

        if (!$response instanceof ResponseInterface) {
            $response = $this->response;
        }

        $this->output->respond($response);
    }
public function listen($errorHandler = null)
    {
        if ($this->handler instanceof \Closure) {
            $this->handler = $this->handler->bindTo($this);
        }

        $response = call_user_func($this->handler, $this->request, $this->response, $errorHandler);

        if (!$response instanceof ResponseInterface) {
            $response = $this->response;
        }

        $this->output->respond($response);
    }
public function listen ( $ errorHandler = null ) { if ( $ this -> handler instanceof \ Closure ) { $ this -> handler = $ this -> handler -> bindTo ( $ this ) ; } $ response = call_user_func ( $ this -> handler , $ this -> request , $ this -> response , $ errorHandler ) ; if ( ! $ response instanceof ResponseInterface ) { $ response = $ this -> response ; } $ this -> output -> respond ( $ response ) ; }
Execute the server.

@param   callable $errorHandler The error handler callback.
Execute the server .