How to telnet from remote server?

How does telnet work with Java server?

  • Hey all, So I'm currently working on a Java server and I want to connect to it via telnet. So we're currently using a DataOutputStream to print out to the telnet, but what do I use to read what ever is inputed from the telnet client?

  • Answer:

    You should have a ServerSocket that creates a Socket every time someone connects to your server. When this happens, you can use that socket to get an InputStream via Socket.getInputStream(). Then, you can wrap that InputStream with whatever type of utility input stream you want (like a DataInputStream). Socket newConnection=ServerSocket.accept(); InputStream socketInputStream=new DataInputStream(newConnection.getInputSt…

pegasus7... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.