by Paco103 » April 14, 2005, 3:05 pm
The only reason the path is included in the search results and therefore get messages is because of the assumption that large majority (probably over 90%) of search hits will never be requested. In the search request (which you already have to implement a lookup table for, so the work should already be done), every thing that goes out is assumed to be coming back, so therefore it makes more sense to store the information locally rather than sending larger packets (which in a large network could be quite large).
You are right that it would be better to include more identifying information in a real world case. If we did that, it would probably use the search ID method. However, in this project we are assuming that file names are unique identifiers, and therefore no further information should be needed. The only way (with this assumption) a mix up could happen is with partial file requests. To handle this, you should probably cache the offset and segment length as well. If the filename, offset, and segment length are the same, then the stream can be assumed to be the same.
Also, if you have 2 clients request the same file through your node, you could fulfill both clients off of the first incoming source stream, and the second one you could disconnect as soon as you parse the header and notice the file stream is the same as the one you are already receiving.
The only reason the path is included in the search results and therefore get messages is because of the assumption that large majority (probably over 90%) of search hits will never be requested. In the search request (which you already have to implement a lookup table for, so the work should already be done), every thing that goes out is assumed to be coming back, so therefore it makes more sense to store the information locally rather than sending larger packets (which in a large network could be quite large).
You are right that it would be better to include more identifying information in a real world case. If we did that, it would probably use the search ID method. However, in this project we are assuming that file names are unique identifiers, and therefore no further information should be needed. The only way (with this assumption) a mix up could happen is with partial file requests. To handle this, you should probably cache the offset and segment length as well. If the filename, offset, and segment length are the same, then the stream can be assumed to be the same.
Also, if you have 2 clients request the same file through your node, you could fulfill both clients off of the first incoming source stream, and the second one you could disconnect as soon as you parse the header and notice the file stream is the same as the one you are already receiving.