On Wed, 22 Aug 2007 16:19:12 GMT, Erik Wikström <Erik-wikstrom@telia.com> wrote:
> On 2007-08-22 18:03, Angus wrote:
>> I am designing an FTP server and with FTP commands are dispatched on
>> one port and the actual data transmission on another.
>>
>> So I thought I would have a CFTPControl class for handlng the commands
>> and a CFTPData class for the actual data transmission.
>>
>> But CFTPControl needs to know when the data transmission has
>> completed. What is the best way to handle this interaction between
>> the classes?
>
> I think your biggest problem is the assumption that you should use those
> classes. The FTP protocol is best modelled by a state machine, figure
> out how to do that and you have a good start.
Yes. The only thing I know about the FTP protocol is that it is more
complex than I think. Hell, it's even hard to find all the relevant
RFCs!
The original poster should make sure he knows more than "there are two
different sockets" before he starts looking for classes -- or he'll
risk having to tear down his design and start from scratch when he,
belatedly, discovers one of the many odd corner cases.
(I just echoed what you said but in many more words, didn't I?)
/Jorgen
--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.dyndns.org> R'lyeh wgah'nagl fhtagn!