Different users with same nick (but in different hubs)

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
andlju
Posts: 27
Joined: 2003-02-28 12:58
Location: Stockholm, Sweden
Contact:

Different users with same nick (but in different hubs)

Post by andlju » 2003-03-16 07:14

Hi.. just trying to write my own client (aren't we all?..), and I've got a question about how DC++ handles the following scenario.. I must admit i didn't dig through the source code, so I might have gotten the whole download-queue, client-connections process wrong..

The client is connected to two different hubs (Hub1 and Hub2). Both hubs have a user logged in called Nick. But, Nick on Hub1 is not the same person (doesn't have the same IP..) as Nick on Hub2.

In the download queue there is one file from each of the users (File1 is from the Nick on Hub1, File2 is from the Nick on Hub2). Now, the client sends a $ConnectToMe to the Nick on Hub2.

In the handshaking process, Nick (from Hub2) will send $MyNick Nick, but he won't tell anything about what hub (s)he is logged in to, i.e. we don't really know if it's the Nick from Hub1 or Hub2 that is connecting.

Now to my question.. How does DC++ know whether to $Get File1 or File2?

The three solutions I've come up with so far are:
1) the client only connects to one Nick at a time, holding state on what connection it is currently hoping for. If the remote part doesn't respond in x seconds, a new user is tried.
2) a unique port is used on each $ConnectToMe for each user - but this would fail when the port is explicitly set in the settings dialogue.
3) the problem is ignored - it won't happen that often

I don't really like to hold a global state on the client (alt. 1), but I guess I'm leaning towards that alternative..

/Anders

seeSharp
Posts: 24
Joined: 2003-04-19 10:03

client identification

Post by seeSharp » 2003-04-19 10:12

Hi!

As far as I know, DC++ knows wich users it is trying to download from. When someone sends a MyNick, then it searches this array, and if the user is found, he is a download source. Otherwise he will try to upload something.

Besides, every transferee should be known. Either you send a $ConnectToMe or you receive it. Or you receive a $RevConnectToMe from a passive user, but then, you can assign it as an uploadee, with the Hub where you received his nick.

Transfers under the same nick on different hubs are not allowed (I think :).

seeSharp
(another one about to make a DC client in C# :)

Locked