Immediately after the connection establishment the client sends several query messages regarding the file it wishes to download.
The basic message exchange is composed from four messages: A sends a file request message immediately followed by a requested
file ID message. B replies to the file request by a file request answer and to the requested file ID message by a file status
message. In my viewpoint, it could be more easier than in this way to adopt two messages (a request and reply).
The extended protocol adds two messages to this sequence a source request and a source answer. This extension is used to pass
B's source to A. To elaborate, there is no requirement that B completes to download a file before it can send file parts to other
clients, B can send to A any part it has completed to download even when it has only a small fragment of the file.
When A requests a file from B, but B does not have this file in its shared files. B skips the file request answer message and
send a file not found message, immmediately after the requested file ID message.
For each uploaded file the client maintains an upload priority queue. The priority of each client in the queue is calculated
on the basis of the client's time in the queue and a priority modifier. At the head of the queue are clients which have the highest
"score". The score is calculated using the following formula: score = (rating * seconds_in_the_queue) / 100 or ∞ in case the downloading
client is defined as a friend. The initial rating value is 100 except for banned users which receive 0 rating (and thus are prevented
from reaching the top of the queue). The rating is modified either by the downloading client's credit (which ranges from 1 - 10)
or by the uploaded file priority (0.2 - 1.8) which is set by the uploading client. When a client's score is higher than the score
of the rest of the clients it starts downloading the file. A client will continue to download a file until one of the following
conditions occurs:
1. The uploading client was terminated by the user;
2. The downloading client has got all the parts is needs for the file;
3. The downloading client was preempted by another downloading client which has higher priority than his.
In order to allow a client which just started downloading to get a few megabytes of data before it is preempted, eMule boosts
the initial rating of a downloading client to 200 for the first 15 minutes of its download.
The basic message exchange is composed from four messages: A sends a file request message immediately followed by a requested
file ID message. B replies to the file request by a file request answer and to the requested file ID message by a file status
message. In my viewpoint, it could be more easier than in this way to adopt two messages (a request and reply).
The extended protocol adds two messages to this sequence a source request and a source answer. This extension is used to pass
B's source to A. To elaborate, there is no requirement that B completes to download a file before it can send file parts to other
clients, B can send to A any part it has completed to download even when it has only a small fragment of the file.
When A requests a file from B, but B does not have this file in its shared files. B skips the file request answer message and
send a file not found message, immmediately after the requested file ID message.
For each uploaded file the client maintains an upload priority queue. The priority of each client in the queue is calculated
on the basis of the client's time in the queue and a priority modifier. At the head of the queue are clients which have the highest
"score". The score is calculated using the following formula: score = (rating * seconds_in_the_queue) / 100 or ∞ in case the downloading
client is defined as a friend. The initial rating value is 100 except for banned users which receive 0 rating (and thus are prevented
from reaching the top of the queue). The rating is modified either by the downloading client's credit (which ranges from 1 - 10)
or by the uploaded file priority (0.2 - 1.8) which is set by the uploading client. When a client's score is higher than the score
of the rest of the clients it starts downloading the file. A client will continue to download a file until one of the following
conditions occurs:
1. The uploading client was terminated by the user;
2. The downloading client has got all the parts is needs for the file;
3. The downloading client was preempted by another downloading client which has higher priority than his.
In order to allow a client which just started downloading to get a few megabytes of data before it is preempted, eMule boosts
the initial rating of a downloading client to 200 for the first 15 minutes of its download.