Non passive FTP support

Sun, Mar 2, 2003

I coded up non passive FTP support for my FTP code. It only took me ~30 mins. I've handed that off to Chris so perhaps it will show up in BlogX at some point. If not, I may write a standalone utility and release that.

It was pretty easy to send the PORT command and start accepting connections. I had to mess around a little bit to get it right so I wish that the documentation around using sockets was better. For instance, there is no short sample that shows creating a socket, binding it to an address and then accepting connections.

BTW, my router (Linksys wireless/4 port) works with both passive and regular FTP connections. It must be monitoring the control connection and (a) rewriting it with the public FTP address and (b) opening the port through to my machine. These little boxes are just amazing.