shay
shay

Reputation: 1357

Java telnet server

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

Answers (3)

m.nguyencntt
m.nguyencntt

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

Christian d'Heureuse
Christian d'Heureuse

Reputation: 5630

I have written a simple Telnet server in Java: TelnetStdioRedirector

Upvotes: 4

ZZ Coder
ZZ Coder

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

Related Questions