Handling asynchronous responses
        Posted  
        
            by James P.
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by James P.
        
        
        
        Published on 2010-05-23T17:44:17Z
        Indexed on 
            2010/05/23
            17:51 UTC
        
        
        Read the original article
        Hit count: 455
        
I'm building an FTP client from scratch and I've noticed that the response codes aren't immediate (which is no surprise). What would be a good approach for getting the corresponding code to a command?
Below is an example of the output of Filezilla server. The response code is the three digits near the end of each line.
(000057) 23/05/2010 19:43:10 - (not logged in) (127.0.0.1)> Connected, sending welcome message...
(000057) 23/05/2010 19:43:10 - (not logged in) (127.0.0.1)> 220-FileZilla Server version 0.9.12 beta
(000057) 23/05/2010 19:43:10 - (not logged in) (127.0.0.1)> 220-written by Tim Kosse ([email protected])
(000057) 23/05/2010 19:43:10 - (not logged in) (127.0.0.1)> 220 Please visit http://sourceforge.net/projects/filezilla/
(000057) 23/05/2010 19:43:10 - (not logged in) (127.0.0.1)> user anonymous
(000057) 23/05/2010 19:43:10 - (not logged in) (127.0.0.1)> 331 Password required for anonymous
© Stack Overflow or respective owner