Gnutella Forums

Gnutella Forums (https://www.gnutellaforums.com/)
-   General Gnutella Development Discussion (https://www.gnutellaforums.com/general-gnutella-development-discussion/)
-   -   Gnutella PHP,QRT example (https://www.gnutellaforums.com/general-gnutella-development-discussion/88076-gnutella-php-qrt-example.html)

Atomical October 8th, 2008 07:49 AM

Gnutella PHP,QRT example
 
I'm testing a PHP Gnutella client and I need to generate a QRT table so I can receive data and test the functionality. I read over the spec and I still can't figure this out or get it right. If anyone could shed some light on what I'm doing wrong that would be amazing! I suspect I'm not packing/formatting the binary data right. Here's my code:

PHP Code:

        //write QRP reset message
        
$variant "\0x0";
        
$table_length pack('V',65536);
        
$infinity pack('C',1);
        
$packet $variant $table_length $infinity;
        
$reset create_header"\30x0"1,0$packet );
        
        
fwrite($fp$reset,strlen($reset));
        
        
        
//4 kilobyte
        
$byte '';
        for ( 
$o 0$o 8/*(1024*4)*/$o++){
            
$byte .= 1;
            
//$byte .= bindec(1111);
            //$byte .= pack('C',1); 
        
        
}
        
        
        
//write qrp table
        
$packet '';
        for ( 
$t =0$t 16$t++ ){
    
            
$variant "\0x1";
            
$seq_no pack('C',$ttt $t+1);
            echo 
"Patch $ttt of 16\n";
            
$seq_size pack('C',16); //bits
            
$compressor "\0x0";
            
$entry_bits pack('C',8);
            
$packet $variant $seq_no $seq_size $compressor $entry_bits $byte;
            
            
$packet create_header("\30x0",1,0,$packet);
            
            

            
fwrite($fp,$packetstrlen($packet));
            
        
        } 


arne_bab October 13th, 2008 02:38 AM

I can't help directly with that.

But I just approved your message to the gdf mailinglist - you should get an answer there.


All times are GMT -7. The time now is 06:35 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.