FTP Port IP address

K

Keith M.

I use a Socket to send the FTP Commands to the Host and
the localendpoint gives me an address of 127.0.0.1, which
is fine but when I send the PORT command I need a new IP
address. That is where my problem is. If i create a new
Socket it still has the same IP address 127.0.0.1. When I
use the commercial client SmartFTP it uses the same
address 127.0.0.1 for the FTP commands and 192.168.0.2 for
the port command. How with .net can I get this IP address?
 
F

feroze

Are you using non-passive mode ? If so, you need to create an accepting
socket, get its local endpoint, and then send that IP to the server.
Socket.LocalEndPOint will give you the local ip.

If you are using passive mode, then you shoul send the "PASV" command to the
servre, the server will open a accepting socket and send you the endpoint.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top