Gnutella Forums

Gnutella Forums (https://www.gnutellaforums.com/)
-   General Discussion (https://www.gnutellaforums.com/general-discussion/)
-   -   Howto realite more than 255 serach results? (https://www.gnutellaforums.com/general-discussion/66123-howto-realite-more-than-255-serach-results.html)

Linuxhippy January 15th, 2007 01:29 PM

Howto realite more than 255 serach results?
 
Hello,

Phex currently "only" supports 255 results per host per query, this is the maximum which may be returned by a single query-result package. Browse host works arround this limitation yb sending many packages, so I tried to change MessageDispatched.respondToQuery to the following, instead of the single-package sending code:

[source]
QueryResponseRecord record;
ShareFile sfile;
int sendCount = 0;
while (sendCount < resultCount)
{
int currentSendCount = Math.min( 255, resultCount
- sendCount );

QueryResponseRecord[] records = new QueryResponseRecord[currentSendCount];
for (int i = 0; i < currentSendCount; i++)
{
sfile = resultFiles[sendCount + i];
Long networkCreateTime = sfile.getNetworkCreateTime();
AltLocContainer altLocContainer = sfile.getAltLocContainer();
Set<DestAddress> altLocs = null;
if ( altLocContainer != null )
{
altLocs = altLocContainer.getAltLocForQueryResponseRecord();
}
record = new QueryResponseRecord( sfile.getFileIndex(),
sfile.getURN(), (int) sfile.getFileSize(),
sfile.getFileName(), networkCreateTime.longValue(),
altLocs );
records[i] = record;
}

NetworkManager networkMgr = NetworkManager.getInstance();
DestAddress hostAddress = networkMgr.getLocalAddress();
QueryResponseMsg queryResponse = new QueryResponseMsg( header,
networkMgr.getServentGuid(), hostAddress,
Math.round(
BandwidthPrefs.MaxUploadBandwidth.get().floatValue ()
/ NumberFormatUtils.ONE_KB ), records );

// send msg over the wire
sourceHost.queueMessageToSend(queryResponse);
// and count message
MessageCountStatistic.queryHitMsgOutCounter.increm ent( 1 );

sendCount += currentSendCount;
}
[/source]

However, how could it be different ... it does not work.

Any ideas what could be the problem? Is phex able to handle multiple responses per query from the same host?

Thank you in advance, lg Clemens


All times are GMT -7. The time now is 05:43 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.