Hi
I want to make a program to connect to a router using Http protocol or Telnet protocol.
I tried running a command prompt on my PC and connecting to the router using telnet commands i used the Process class but i failed
java telnet leads to several Telnet libraries. Surprisingly, Apache Commons Net isn't found on the first two pages, so I thought I'd mention it explicitly.
HTTP is probably going to be more difficult as it will certainly involve a bit more complex requests. HttpClient can be a great help.
Please don't use such a large font. I've had to remove the formatting on both of your posts already. Also, UseCodeTags from now on. See how much easier your code is to read.
Why didn't you use a Telnet library like I suggested?
The Windows telnet client is a GUI client that doesn't take commands on the command line; something tells me he's just using that stock client, anyway.
There's a slight difference. readLine is able to handle \r, \n and \r\n as line breaks. It did (does?) have a bug that if the stream ends with a \r without a \n after it, readLine would block.