ADC’s client-client handshake

I previously wrote about NMDC’s client-client handshake sequence, and today I thought I’d talk about ADC’s handshake sequence.

As with the previous post, there’s going to be a client and a server that speaks, where the ‘client’ is the one that want to download and ‘server’ that one that’s going to upload.

For starters, the required commands are “SUP”, “INF”, “GET” and “SND”. The INF is going to contain the users CID, but I’ll use the same CID for both for simplicitly sake. [The both CIDs will still be the same size…]

(Note that the ‘\n’ is one character.)

Server
CSUP ADBASE\n

Client
CSUP ADBASE\nCINF IDWTFUTQBI4NT6MKTRT2EHSMGZM5H2BVM5IZD65FA\n

Server
CINF IDWTFUTQBI4NT6MKTRT2EHSMGZM5H2BVM5IZD65FA TO123456789\n

Client
CGET file TTH/PPUROLR2WSYTGPLCM3KV4V6LJC36SCTFQJFDJKA 0 -1\n

Server
CSND file TTH/PPUROLR2WSYTGPLCM3KV4V6LJC36SCTFQJFDJKA 0 12345\n

At which point the server starts streaming the file to the client. (The client will of course stop listening for the file when 12345 bytes have been received, and disconnect or send another GET. )

The server has sent 133 characters, or bytes. The client has sent 120 characters, or bytes.

This is pretty much what a normal client to client handshake sequence looks like. Note that the token (after the TO) is completely arbitrary. Also, the INF may contain more information; This is just what is required. I don’t see a point at the moment to send more stuff, but oh well…

Don’t forget that you can make topic suggestions for blog posts in our “Blog Topic Suggestion Box!”

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: