Register Server Lock2Key

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

TasMan
Posts: 196
Joined: 2003-01-03 13:31
Location: Canada

Register Server Lock2Key

Post by TasMan » 2003-02-23 22:08

[quote=http://www.lwave.ca/shasta/protocol.html]
When the hub connects to the hublist, it must undergo a similar Lock/Key negotiation. The <key> calculation is the same, but the special number 5 in the second step is replaced with the following value computed from the hub's port, <localport>:

((localport>>8) + (localport & 255)) & 255
[/quote]

So the equivalent to this in VB would be :

Code: Select all

((Winsock.LocalPort \ (2^8)) + (Winsock.LocalPort And 255)) And 255

TasMan
Posts: 196
Joined: 2003-01-03 13:31
Location: Canada

Post by TasMan » 2003-02-23 22:09

Not that it matters, but that should read :


When the hub connects to the hublist, it must undergo a similar Lock/Key negotiation. The <key> calculation is the same, but the special number 5 in the second step is replaced with the following value computed from the hub's port, <localport>:

((localport>> + (localport & 255)) & 255

sandos
Posts: 186
Joined: 2003-01-05 15:16

Post by sandos » 2003-02-23 22:16

Id say calling it localport is a bit confusing, as it depends on which side youre at. Its actually the source-port if you ask me, as opposed to destination port, which should be 2501 for a hublist server.

Who is online

Users browsing this forum: Google [Bot] and 0 guests