4

Does anyone know of a simple telnet server?

I want to embed in my application and set my own commands something simple not complex .

Jan
  • 13,738
  • 3
  • 30
  • 55
shay
  • 1,317
  • 4
  • 23
  • 35

3 Answers3

7

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.

ZZ Coder
  • 74,484
  • 29
  • 137
  • 169
  • ok question about telnetd what should i do in cases when i can send many commands and get response without closing the connection immediately like all of the examples in telnetd shows – shay Jul 09 '10 at 17:24
4

I have written a simple Telnet server in Java: TelnetStdioRedirector

Christian d'Heureuse
  • 5,090
  • 1
  • 32
  • 28
1

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());
    }
}
m.nguyencntt
  • 935
  • 13
  • 19