0

When I use MS telnet, I'm getting every character repeated WITHOUT CRLF but with OSX telnet, my input is not sent to server until I CRLF.

So I found I can first open (MS) telnet and type

set crlf

but then when I try to open the connection, the client sits there and says it's Connecting but then fails!

What's the difference between these commands below and how can I connect by using open command?

Commands:

Working:

telnet localhost 8010 // but I get unwanted auto-send

Not working:

telnet
set crlf

open localhost 8010

Code:

   public class SingleThreadedBlockingServerBasic {

    public static void main(String[] args) throws IOException {


        ServerSocket serverSock = new ServerSocket(8010);


        while (true) {

            // Connect client and serverSock - Tell serverSock to accept client Socket
            Socket client = serverSock.accept();

            InputStream in = client.getInputStream();
            OutputStream out = client.getOutputStream();

            int data;

            // Read the int-read into the 8k buffer at offset 0 from the inputstream. inputstream receives data off
            // of the client Socket.
            in.transferTo(out);
        }
    }
}
chrips
  • 4,996
  • 5
  • 24
  • 48
  • 1
    Probably a difference in how the telnet clients work. – K.Nicholas Jun 04 '19 at 20:03
  • @K.Nicholas They're the same client ... – chrips Jun 04 '19 at 21:17
  • "MS telnet, I'm getting every character repeated WITHOUT CRLF but with OSX telnet," -> MS telnet is not OSX telnet. – K.Nicholas Jun 04 '19 at 21:20
  • @K.Nicholas Right, with OSX it is different. So what I'm saying is that when I try to set crlf with Windows telnet...I then can't connect. So the question is why can't I use open with MS telnet? I'm not asking about OSX – chrips Jun 04 '19 at 21:22
  • 1
    Most likely MS telnet is not the right tool for your needs. – President James K. Polk Jun 05 '19 at 00:40
  • @JamesKPolk I'm testing Java sockets so its part of a course but the instructor is gone from Q&A. I think this is a common way to learn about sockets or test certain environments or applications. I guess... – chrips Jun 05 '19 at 01:06
  • You could save a lot of headache by using [PuTTY](https://www.putty.org/) rather than (MS) telnet. – Armali Jun 05 '19 at 09:53
  • 1
    @Armali Oh wow you're right....... thanks for telling me! – chrips Jun 05 '19 at 23:12

0 Answers0