$Direction client <-> client question

Technical discussion about the NMDC and <a href="http://dcpp.net/ADC.html">ADC</A> protocol. The NMDC protocol is documented in the <a href="http://dcpp.net/wiki/">Wiki</a>, so feel free to refer to it.

Moderator: Moderators

Locked
Borf
Posts: 2
Joined: 2004-08-26 16:34
Location: Netherlands
Contact:

$Direction client <-> client question

Post by Borf » 2004-08-26 16:42

hi,

I'm working on a crossplatform-client for the DC network at the moment, something like dctc, and I'm currently working on the client <-> client protocol, but I still don't get the $Download <Upload|Download> <anumber>| thing...could anyone please explain it to me (for example, what happens if there's 2×Download, will a new connection be made and by who ?) Please don't point me to the wiki or to Sed's protocol description.
Last edited by Borf on 2004-08-27 05:54, edited 1 time in total.

ivulfusbar
Posts: 506
Joined: 2003-01-03 07:33

Post by ivulfusbar » 2004-08-27 01:03

$Direction in client-client is used to determine if the listening client is a uploading or downloading client. This is needed because If user A is active and user B is passive. If user A wants something from user B at same time as user B wants something from user A.
User A will send $ConnectToMe to get B to connect to its listening port. User B will send $RevConnectToMe to be able to get user A to send $ConnectToMe to user B so that it can connect to user A.

On the listening socket that client A has, he can't determine if the incoming connection from B is the result of its own need to download, or if its the result of the fact that B wants to download. To determin which is which we will have a sort of Direction-fight.

The argument is an integer, Integers will be compared to find the largest integer. The largest integer will win.

After the direction-integer-comparison-battle, the direction of the connection is fixed and will not be changed or re-sent during the connections lifetime.

Most dc-clients will only allow one upload-connection / client. Clients will be identified by nickname + guess hubname.
Everyone is supposed to download from the hubs, - I don´t know why, but I never do anymore.

Borf
Posts: 2
Joined: 2004-08-26 16:34
Location: Netherlands
Contact:

Post by Borf » 2004-08-27 05:53

Thanks for your reply, I think I can use this :D ......

Locked