🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #229

ftp client

#229
From: congzb
Date: Fri, 17 Feb 2006 10:48
59 lines
2307 bytes
hello all
see my program following:

	public static void main(String args[]) {
		Socket socket = null;
		BufferedReader in = null;
		PrintWriter out = null;
		String line = null;

		try {
			socket = new Socket("myserver", 21);
			in = new BufferedReader(new InputStreamReader(socket
					.getInputStream()));
			out = new PrintWriter(socket.getOutputStream());
			out.println("user " + "congzb");
			out.println("pass " + "1qazxsw2");
			out.println("pwd");

			
			out.println("pasv");
			out.println("list");

			out.println("quit");
			out.flush();

			while ((line = in.readLine()) != null) {
				System.out.println(line);
			}

		} catch (Exception e) {
			System.out.println(e.getMessage());
		} finally {
			try {
				out.close();
				in.close();
				socket.close();
			} catch (Exception fe) {
				System.out.println("RESOURCE CLOSE EXCEPTION "
						+ fe.getMessage());
			}
		}
	}



the trace info as following:

331 Password required for congzb.
230-Last unsuccessful login: Fri Feb 17 02:21:26 EST 2006 on /dev/pts/1 from 9.186.23.101
230-Last login: Fri Feb 17 05:59:26 EST 2006 on ftp from ::ffff:9.186.23.101
230 User congzb logged in.
257 "/home/congzb" is current directory.
227 Entering Passive Mode (9,56,249,42,152,101)


in fact, it hang on "pasv" command. and don't give me the answer of "list" command.

why? thanks
Technical Details
Message-ID: <43f5b81b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!txtfeed1.tudelft.nl!tudelft.nl!txtfeed2.tudelft.nl!multikabel.net!feed20.multikabel.net!news2.euro.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,8ff86596ca28d3bf,start
X-Google-Attributes: gidf74b3,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "congzb" <zhebincong@tom.com>
Sender: "congzb" <zhebincong@tom.com>
Reply-To: "congzb" <zhebincong@tom.com>
Subject: ftp client
Newsgroups: borland.public.jbuilder.java.language
X-User-Info: 202.108.130.138     
NNTP-Posting-Host: 207.105.83.66
Message-ID: <43f5b81b$1@newsgroups.borland.com>
Date: 17 Feb 2006 03:48:43 -0700
X-Trace: newsgroups.borland.com 1140176923 207.105.83.66 (17 Feb 2006 03:48:43 -0700)
Lines: 59
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!txtfeed1.tudelft.nl!tudelft.nl!txtfeed2.tudelft.nl!multikabel.net!feed20.multikabel.net!news2.euro.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail