I am trying to create a simple ftp client using the winsock control. I am unable to find a way to detect when a server message (of multiple lines) is finished sending.

for example when you login to ftp.microsoft.com:

220 cpmsftftpa03 Microsoft FTP Service (Version 5.0).
USER anonymous
331 Anonymous access allowed, send identity (e-mail name) as password.
PASS [email protected]
230-This is FTP.MICROSOFT.COM. Please see the

230-dirmap.txt for more information.
230 Anonymous user logged in.


how would i detect that the 3rd line is the last 230 being sent? (The number and message is different for every server)

Please Help!
thanks