protected function sendResponseHeadersToClient(WebRequest $request, $code, $message)
    {
        $headers = [
            "Date"       => gmdate("D, d M Y H:i:s T"),
            "Connection" => "close"
        ];
        
        $bytes = $this->sendToClient($request->getVersion() . " {$code} {$message}\r\n");
        foreach($headers as $header => $value) {
            $bytes += $this->sendToClient("{$header}: {$value}\r\n");
        }
        $bytes += $this->sendToClient("\r\n");
        
        return $bytes;
    }
protected function sendResponseHeadersToClient(WebRequest $request, $code, $message)
    {
        $headers = [
            "Date"       => gmdate("D, d M Y H:i:s T"),
            "Connection" => "close"
        ];
        
        $bytes = $this->sendToClient($request->getVersion() . " {$code} {$message}\r\n");
        foreach($headers as $header => $value) {
            $bytes += $this->sendToClient("{$header}: {$value}\r\n");
        }
        $bytes += $this->sendToClient("\r\n");
        
        return $bytes;
    }
protected function sendResponseHeadersToClient ( WebRequest $ request , $ code , $ message ) { $ headers = [ "Date" => gmdate ( "D, d M Y H:i:s T" ) , "Connection" => "close" ] ; $ bytes = $ this -> sendToClient ( $ request -> getVersion ( ) . " {$code} {$message}\r\n" ) ; foreach ( $ headers as $ header => $ value ) { $ bytes += $ this -> sendToClient ( "{$header}: {$value}\r\n" ) ; } $ bytes += $ this -> sendToClient ( "\r\n" ) ; return $ bytes ; }
Sends the response headers through the client socket

Returns the number of bytes sent.

@param  WebRequest $request The http request
@param  int $code The http status code to sent
@param  string $message The http status message to send
@return int
Sends the response headers through the client socket