Reputation: 1357
Does anyone know of a simple telnet server?
I want to embed in my application and set my own commands something simple not complex .
Upvotes: 4
Views: 9805
Reputation: 943
I did as below
public static void main(String[] args) {
String url = "hostname";
int port = 8080;
try (Socket pingSocket = new Socket(url, port)) {
try (PrintWriter out = new PrintWriter(pingSocket.getOutputStream(), true); BufferedReader in = new BufferedReader(new InputStreamReader(pingSocket.getInputStream()));) {
out.println("ping");
System.out.println("Telnet Success: " + in.readLine());
}
} catch (IOException e) {
System.out.println("Telnet Fail: " + e.getMessage());
}
}
Upvotes: 1
Reputation: 5630
I have written a simple Telnet server in Java: TelnetStdioRedirector
Upvotes: 4
Reputation: 75496
Try this one,
http://code.google.com/p/telnetd-x/
A telnetd alone is useless. You have to connect it to a shell. We use jacl and jyson as shell.
Upvotes: 7