how to connect data port with a ftp server
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, February 2, 2004 11:32 PM

Sir, I am working to write a ftp client in java. I've established a control connection to the server. but i cannot connect to its data port either active or passive.
I tried to use Serversocket while active and Socket while passive connections. when i get the servers port by pasv, i put the ip address and portnumber in the Socket constructor.but no connection was formed please instruct me urgently. sometimes i've got an error called port out of range exception tell me how to overcome this.

Re: how to connect data port with a ftp server

Posted By:   Christopher_Koenigsberg  
Posted On:   Tuesday, February 3, 2004 06:40 AM

...sometimes i've got an error called port out of range exception...


If you're running on a Unix system (Linux, Solaris, MacOS, ...) and you're not running as "root", it won't let you listen on a local port numbered lower than 1024 (Unix considers low-numbered ports to be "privileged"). I don't know if this is the cause of your exception or not. But if it is, when you choose a data port number (and when you are going to listen on it yourself), you have to choose an unused high-numbered one.

About | Sitemap | Contact