Yes, you certainly can do it through sockets; you'll need to use two of them, one to port 21 of your FTP server (for the commands) and one to port 20 (for the data itself). Of course, you'll have to read up on the
FTP protocol. It's not really hard, but it's also non-trivial.