Whenever one runs into this kind of problems, FTP, HTTP, NNTP or similar simple protocols, the first thing to do is to start up a telnet client and connect to the server on the correct port using that. Then, type the commands/requests manually, and see exactly what responses you get. Then, you know what you are working with on the other end.
Also useful is to make a tiny proxy app, where you connect to your app, which then connects to the server. Then, your app sits in the middle and listens to everything that's sent and recieved, and you can log it all. That should allow you to debug almost all network problems.