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.
$Direction client <-> client question
Moderator: Moderators
$Direction client <-> client question
Last edited by Borf on 2004-08-27 05:54, edited 1 time in total.
-
- Posts: 506
- Joined: 2003-01-03 07:33
$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.
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.