[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sockets, Sessions, Session handles, and FD handles
Working with FTPAPI (and in particular the session management piece)
I'm finding myself confused by the interchangeable use of _words_ like
session and socket when the two _meanings_ don't seem to be
interchangeable.
For example, FTP_delete is called with first parameter peSession. It
calls the selectSession(peSession) function, which loops through its
occurrences, looking for a "session" where "wkSocket" is equal to
peSession. It then uses the ordinal position of the located match as
a parameter to cmd_occurrsession, which will in turn make that
"located" session the "current" one. OK so far (if we must; it's all
changing anyway). So now, if I've done my math correctly, peSession
is equal to wkSocket.
Then back at FTP_delete, we SendLine() to the wkSocket from the
current occurrence... and if successful, we try to get a reply from
our first parameter (peSession). This (send to wkSocket; receive from
peSession) is done consistently throughout the FTP_* procedures. Then
in tsend it is no longer session or socket... instead, it is wwFD!
Now correct me if I'm wrong, but wouldn't wkSocket and peSession
contain the same value? I think so, so why all this confusion?!?!
There must be an interesting history here that I'm missing, but I just
want to make sure I get this right before I hand it back for you
folks to bless.
To make matters worse, there are procedures that take peSession as a
parameter where peSession is intended to be an ordinal index, and
other procedures where peSession is a socket handle. And the final
clincher is that both session index and socket handle are 4-byte
integers. All of this seems to invite mistakes.
So... is it just me or is there a serious need for nomenclature
changes in this area? I truly don't want to step on any toes here (I
do that enough elsewhere), so please take my questions and comments in
the light of one who wants to improve a process.
I am actually moving fairly quickly on the changes - it's going even
better than I'd hoped, and now it's time to examine the use of that
wkSession field, and that's the reason I'm focusing on this now.
Dennis E. Lovelady
AIM/Skype: delovelady MSN: fastcounter@xxxxxxxxxxxx
[1]www.linkedin.com/in/dennislovelady --
"As your attorney, it is my duty to inform you that it is not
important that you understand what I'm doing or why you're paying me
so much money. What's important is that you continue to do so."
-- Hunter S. Thompson's Samoan Attorney
References
1. http://www.linkedin.com/in/dennislovelady
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------