The problem is I only found a little description about port 17, also known as "Quote of the date" port. Useless port, does nothing but display a quote which is less than 512 ASCII characters. Could someone give me more information about how to listen to port 17 in Java? I have established a server client socket using port:6017.
Here is the code:
public class DateServer {
public static void main(String[] args) {
try {
ServerSocket sock = new ServerSocket(6017);
// now listen for connections
while (true) {
Socket client = sock.accept();
// we have a connection
PrintWriter pout = new PrintWriter(client.getOutputStream(), true);
// write the Date to the socket
pout.println(); // I know something must happens here!!!
// close the socket and resume listening for more connections
client.close();
}
} catch (IOException ioe) {
System.err.println(ioe);
}
}
}
The system runs in Linux and this code is the server end of the program. I am working on the Client part, and try to make the server do the same thing like port 17 then have a client to receive the "quote of the day" from the server.