Reputation: 765
I'm hoping to write a simple FTP-like app, including both the client and the server in a Microsoft environment. I say FTP-like because I won't need to follow FTP protocol, I just want to build a client that can send a directory + file string to a server, and then have that server either send back the contents of the file, or send the file itself.
Right now my pseudo-code is something like this:
FTP Client: - open socket - send file string to server - other functionality as desired - receive response
FTP Server: - open socket - new thread for every incoming connection - receives file string - checks to see if file string is in the right format and if the file exists - sends response to client to tell if string was valid - either open up and read text files, or transfer the file itself - send file or contents of file back to client
Does that general skeleton make sense? Is there anything obvious that I might be missing? I was thinking that I might need one socket each for the status and transfer. Any tips or general direction on how to proceed further with this project would be appreciated.
Upvotes: 1
Views: 1534
Reputation: 765
I ended up finishing the project after a good amount of research and rifling through other established FTP servers.
I did end up stripping down the project to a bare bones version but also used FTP protocol at a very basic level, which meant creating a socket to send commands, as well as a socket to send files.
So the basic structure of my app could recurse directories and send all files within the directory using those two sockets and a basic looping structure.
Upvotes: 0