Right now, I made a simple server in java as so:
import Java.net.*;
import Java.io.*;
import Java.util.*;
class Server{
public static void main(String[] args){
int PORT = 13;
try(ServerSocket server = new ServerSocket(PORT)){
while(true){
try(Socket connection = server.accept()){
Writer out = new OutputStreamWriter(connection.getOutputStream());
Date now = new Date();
out.write(now.toString());
out.flush();
connection.close();
} catch(IOException ex){}
}
}
catch(IOException ex){
System.err.println(ex);
}
}
}
I compile and run this from the command line. Being on Port 13, I try to run this on telnet as so: telnet localhost 13
but all it gives me is "Connection to host lost". Mind you, I did this after enabling telnet on Windows 10 and installing it. Is there a simple step I'm missing?