Passive D client <> Active U client communication

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
chaz
Posts: 5
Joined: 2004-03-12 07:33

Passive D client <> Active U client communication

Post by chaz » 2004-03-12 07:54

Hi all,

I have one question...
Can someone put me the communication between clients (a Downloader and an Uploader) ??
I would have the communication for an active D and for a passive one.
Because i'm starting in making a passive one and i can't make it working.

I have this help for an active one :

Client <-> Client Communication in DC. 11-05-2002. By aDe
----------------------------------------------------------

ACTIVE FILE DOWNLOAD
----------------------
D = downloader
U = uploader
H = hub

D>H: $ConnectToMe <U's username> <D's IP and port>|
H>U: $ConnectToMe <U's username> <D's IP and port>|
U>D: Connection
U>D: $MyNick <U's nick>|$Lock <new lock with pk>|
D>U: $MyNick <D's nick>|$Lock <new lock with pk>|$Direction Upload <anumber>|$Key <key for U's lock>|
U>D: $Direction Download <anumber>|$Key <key for D's lock>|
D>U: $Get <filepath + filename in exact case>$<start at byte (1=beginning of file)>|
U>D: $FileLength <length of the requested file>|
D>U: $Send|
U>D: Data, in many chunks.
D>U: $Send| <- when 40906 bytes are sent, ask for more


But I need the passive communication too (mean D connects to U after sending him a $RevConnectToMe and after U send D back a $ConnectToMe)


I think this should be like this, but it don't work :

PASSIVE FILE DOWNLOAD
----------------------
D = downloader
U = uploader
H = hub

D>H: $RevConnectToMe <D's username> <U's username>|
H>U: $RevConnectToMe <D's username> <U's username>|
U>H: $ConnectToMe <D's username> <U's IP and port>|
H>D: $ConnectToMe <D's username> <U's IP and port>|
D>U: Connection
D>U: $MyNick <D's nick>|$Lock <new lock with pk>|
U>D: $MyNick <U's nick>|$Lock <new lock with pk>|$Direction Upload <anumber>|$Key <key for D's lock>|
D>U: $Direction Download <anumber>|$Key <key for U's lock>|
D>U: $Get <filepath + filename in exact case>$<start at byte (1=beginning of file)>|
U>D: $FileLength <length of the requested file>|
D>U: $Send|
U>D: Data, in many chunks.
D>U: $Send| <- when 40906 bytes are sent, ask for more

Problem is I can't get nothing after D send $Key... U won't reply me to a $Get or $GetListLen... !!! HHHHEEELLLPPPP ! :)

Thanks by advance,

Chaz

chaz
Posts: 5
Joined: 2004-03-12 07:33

more precisions

Post by chaz » 2004-03-12 14:14

Hi again,

more precisions for my problem... :

I don't know if it's a socket problem (a coding error) or if i have made a bad implementation of the protocol ?

I think it's a bad implementation problem because in my client to client communication in can go to :

ACTIVE FILE DOWNLOAD
----------------------
D = downloader
U = uploader
H = hub

D>H: $ConnectToMe <U's username> <D's IP and port>|
H>U: $ConnectToMe <U's username> <D's IP and port>|
U>D: Connection
U>D: $MyNick <U's nick>|$Lock <new lock with pk>|
D>U: $MyNick <D's nick>|$Lock <new lock with pk>|$Direction Upload <anumber>|$Key <key for U's lock>|
U>D: $Direction Download <anumber>|$Key <key for D's lock>|

And nothing ... D (in my tests is a dc++ client that will get the U's filelist, and U is my developping client) don't send any more commands ... whyyyyyy ???

It's the same thing in an active communication (D passive, my client and U active, my dc++ client).

Hope this will help you and me to find THE solution to my problem,


Chaz

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2004-03-12 20:38

For starters... are you sniffing the communications? Ethereal is free and nice.

chaz
Posts: 5
Joined: 2004-03-12 07:33

On the road again... again

Post by chaz » 2004-03-12 22:14

Yeah sniffing you're right ! i'll try it now. Thanks

Chaz

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Re: On the road again... again

Post by GargoyleMT » 2004-03-12 22:23

chaz wrote:Yeah sniffing you're right ! i'll try it now.
=) It's not really an answer to your question, but by using DC++ in passive mode in place of your client, you should be able to see what it does differently. You can test out NMDC as well - I hear Jon has a new weekly build on his news page.

chaz
Posts: 5
Joined: 2004-03-12 07:33

Post by chaz » 2004-03-13 00:43

Hi :)

Thanks for your idea of ethereal I solve my problem with it !

It was and wasn't a bad implementation of the protocol by myself in my client, something very silly : \015\012 chars at the end of each raw line sent to the socket (shame on me :).

But it's strange that when the client to client connection is made, I can go through (being U) the $Key process... so $MyNick and $Lock are well interpreted by dc++ with \015\012 but not the $Key !

I realize I don't speak about my developping client... it's not a frontend to user interface, it's a front end to software interface between protocol and a GUI for example. To be more precise it is a perl library Net::DC !


Thanks again, I can now go to bed, freed :)

Chaz

chaz
Posts: 5
Joined: 2004-03-12 07:33

Post by chaz » 2004-03-13 00:44

the name of the library is Net::DC without the smiley ;p

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2004-03-13 13:01

More diversity in clients is good, as long as they all inter-operate without issues. Keep up the work! :wink:

Locked