#include <DynamicSearch.h> [code]
Inherits QObject.
Inheritance diagram for Gnutella::PacketProcessing::DynamicSearching::DynamicSearch:


Definition at line 38 of file DynamicSearch.h.
Public Types | |
| typedef QList< PacketSession * > | Sessions |
Signals | |
| void | searchStopped (const Query &) |
| void | statusRequest (const QueryStatusRequest &) |
Public Member Functions | |
| DynamicSearch (const Query &, Sessions) | |
| ~DynamicSearch () | |
| void | startSearch () |
| void | stopSearch () |
| void | countHits (const QueryHits &) |
| Counts the hits in the QueryHits packet. | |
| void | countHits (const QueryStatusResponse &) |
| Reads the hits count from the QueryStatusResponse packet. | |
| void | addSession (PacketSession *session) |
| Adds a new session to the list of sessions which can be queried. | |
| void | removeSession (PacketSession *session) |
| Removes a session that is no longer available from the internal list. | |
Private Slots | |
| void | timeout () |
| The slot which processes timer events. | |
Private Member Functions | |
| DynamicSearch (const DynamicSearch &) | |
| DynamicSearch & | operator= (const DynamicSearch &) |
| bool | hasEnoughHits () |
| void | doProbeQuery () |
| Sends a probe query over one or more connections. | |
| void | doQuery () |
| Sends a query to one or more connections. | |
| void | sendPacket (quint16 sessionsCount, bool dropSessions=true) |
| Sends the query packet over sessionsCount sessions. | |
| void | sendStatusRequest () |
| Send a QueryStatusRequest packet. | |
| quint32 | hostsPerConnection (quint16 ttl) |
| Calculates the number of host that are reachable within the given ttl. | |
| qint16 | computeTtl (quint32 hostToQuery, quint16 numConnections) |
| Returns the ttl required to reach hostsToQuery over numSessions. | |
Private Attributes | |
| DynamicSearchPrivate * | p |
|
|
Definition at line 44 of file DynamicSearch.h. |
|
|
|
|
||||||||||||
|
Definition at line 78 of file DynamicSearch.cpp. |
|
|
Definition at line 88 of file DynamicSearch.cpp. |
|
|
Adds a new session to the list of sessions which can be queried.
Definition at line 242 of file DynamicSearch.cpp. |
|
||||||||||||
|
Returns the ttl required to reach hostsToQuery over numSessions.
Definition at line 269 of file DynamicSearch.cpp. |
|
|
Reads the hits count from the QueryStatusResponse packet. The QueryStatusResponse packet contains the number of hits that passed all client-side filters. This number should be used when calculating parameters for the next round of the dynamic search. Definition at line 223 of file DynamicSearch.cpp. |
|
|
Counts the hits in the QueryHits packet.
Definition at line 210 of file DynamicSearch.cpp. |
|
|
Sends a probe query over one or more connections. A probe query (over one or more connections) is sent in the beginning of each new search in order to gain some initial knowledge about the popularity of the given query. The dynamic search is further performed in sendQuery(). Definition at line 120 of file DynamicSearch.cpp. |
|
|
Sends a query to one or more connections. Called for each query step (normally after a timeout elapses). Calculates the TTL of the query, and the number of connections to send it over. An initial query whose aim is to "probe" the popularity of the search is sent by sendProbeQuery(). Definition at line 142 of file DynamicSearch.cpp. |
|
|
Definition at line 105 of file DynamicSearch.cpp. |
|
|
Calculates the number of host that are reachable within the given ttl.
Definition at line 255 of file DynamicSearch.cpp. |
|
|
|
|
|
Removes a session that is no longer available from the internal list.
Definition at line 249 of file DynamicSearch.cpp. |
|
|
|
|
||||||||||||
|
Sends the query packet over sessionsCount sessions. The function sends the query over sessionsCount sessions. If dropSessions is true, then the sessions will be removed from the list and not query will be send again over any of them. If dropSessions is false, then the sessions will be moved to the back of the sessions list and could be queried again later. The latter is useful for the session over which we send the probe queries (see doProbeQuery()) Definition at line 293 of file DynamicSearch.cpp. |
|
|
Send a QueryStatusRequest packet. Sends a QueryStatusRequest packet to request the client to report the number hits that have passed the client's filters. After sending the request the DynamicSearch will wait for the QueryStatusResponse packet before performing the next round of the dynamic search algorithm. Definition at line 173 of file DynamicSearch.cpp. |
|
|
Definition at line 93 of file DynamicSearch.cpp. |
|
|
|
|
|
Definition at line 99 of file DynamicSearch.cpp. |
|
|
The slot which processes timer events.
Definition at line 184 of file DynamicSearch.cpp. |
|
|
Definition at line 75 of file DynamicSearch.h. |