Error reading a socket
Hello, please i need some help.
I have a method which is reading from Sockets inputStream
i need to read multi-line response
i have
String temp = "";
while( (temp = in.readLine()) != null)
{
//Process line
}
But is seems, that it didnt end when server responds, but waits until timeout.
What should i do?
Thanks for help.
[395 byte] By [
bobiseka] at [2007-11-27 3:58:45]

# 1
Are you sure the socket is sending multi-lines (I mean really sure) because, assuming 'in' is a BufferedReader, your code WILL read lines if the server is sending lines.
# 3
FTP server use two sockets. One for command and one for data. I assume that you are trying to implement and FTP client. Don't bother because there are several good open source Java FTP clients. For one, google for 'jakarta commons net' .
# 4
Yes i know, but it is mz school project and i can not use external libraries. I have to do it myself.
I managed to authenticate, but i have problems establishing second socket for data transfer. I dont need all function of FTP i need only get list of files in directory, download one of them and be able to upload to directory. I know the FTP commands , but i am unable to implement this in java. Main problem is as i said establishing second socket.