G
Guest
I wrote a program that uses windows sockets to download files from a ftp server. It works quite well however I have a couple of snags.
First (and most important) snag: While calling the recieve(buffer,bufferSize,SocketFlags.None) I have no idea how to tell when I have recieved all the data back from a response. Nor do I know how to tell how large the incomming file is (short of querying it beforehand for its size... not exactly what I'm looking for.) I initially found some code on the net that used vbCrLf... it searched for that combination in the data retrieved to signal eof. I was using this combination and all seemed well until I logged onto a different server that had a vbCrLf in the welcome message. <doh>. Just calling the function over and over again until it times out isn't desirable either, this causes uneeded lag in my app and also caused some other error to occur later on in my code. Any input would be appreciated
Second (and not quite as important) While downloading from a unix ftp server (or whatever ftp.netscape.com uses, forgive me for listing that server here.... I'm not aware of any ms servers running a unix ftp server I got 'bonus' bytes back in the data. The exe I downloaded would not run so I downloaded with a different FTP app - the exe worked fine. So I did a windiff of the files, 'Files differ only in spaces', any ideas why I'm getting bonus bytes? I'd like an exchange for the original file please :-
Any help on either item is much appreciated
-- Anthony
First (and most important) snag: While calling the recieve(buffer,bufferSize,SocketFlags.None) I have no idea how to tell when I have recieved all the data back from a response. Nor do I know how to tell how large the incomming file is (short of querying it beforehand for its size... not exactly what I'm looking for.) I initially found some code on the net that used vbCrLf... it searched for that combination in the data retrieved to signal eof. I was using this combination and all seemed well until I logged onto a different server that had a vbCrLf in the welcome message. <doh>. Just calling the function over and over again until it times out isn't desirable either, this causes uneeded lag in my app and also caused some other error to occur later on in my code. Any input would be appreciated
Second (and not quite as important) While downloading from a unix ftp server (or whatever ftp.netscape.com uses, forgive me for listing that server here.... I'm not aware of any ms servers running a unix ftp server I got 'bonus' bytes back in the data. The exe I downloaded would not run so I downloaded with a different FTP app - the exe worked fine. So I did a windiff of the files, 'Files differ only in spaces', any ideas why I'm getting bonus bytes? I'd like an exchange for the original file please :-
Any help on either item is much appreciated
-- Anthony