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);
}
}
}