public function sendFile($event, $req, $res, $path)
    {
        clearstatcache();
        $filesize = sprintf("%u", filesize($path));
        
        $res->headers->set('Content-Length', $filesize);
        
        $res->headers->set('Accept-Ranges', 'bytes');
        
        if($req->method == 'HEAD') {
            return ;
        }
        
        if(in_array($res->mimeType, $this->gzip_types) && 
            $this->sendGzipContent($event, $req, $res, $path, $filesize)) {
            return ;
        }
        
        if($this->attachFile($event, $req, $res, $path, $filesize)){
            
            $data = [
                'req' => $req,
                'res' => $res,
                'path' =>$path,
                'filesize' => $filesize
            ];
            $event->sender->on(Server::ON_BUFFER_DRAIN, [$this, 'sendPartial'], $data);
        }
    }