Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in input from Telnet terminal #537

Open
ljosa opened this issue Feb 27, 2021 · 4 comments
Open

Regression in input from Telnet terminal #537

ljosa opened this issue Feb 27, 2021 · 4 comments

Comments

@ljosa
Copy link
Contributor

ljosa commented Feb 27, 2021

The demo in TelnetTerminalTest.java no longer works.

Bisecting shows that it broke with commit 04acb75.

After connecting, the telnet connection is lost immediately. Here is the stack trace and output:

terminal$ java -cp ~/tmp/lanterna/src/main/java:~/tmp/lanterna/src/test/java com.googlecode.lanterna.terminal.TelnetTerminalTest
Resized to {113x36}
java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:150)
        at java.net.SocketInputStream.read(SocketInputStream.java:121)
        at com.googlecode.lanterna.terminal.ansi.TelnetTerminal$TelnetClientIACFilterer.fillBuffer(TelnetTerminal.java:277)
        at com.googlecode.lanterna.terminal.ansi.TelnetTerminal$TelnetClientIACFilterer.available(TelnetTerminal.java:246)
        at com.googlecode.lanterna.terminal.ansi.TelnetTerminal$TelnetClientIACFilterer.read(TelnetTerminal.java:256)
        at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
        at java.io.InputStreamReader.read(InputStreamReader.java:184)
        at java.io.BufferedReader.fill(BufferedReader.java:161)
        at java.io.BufferedReader.read(BufferedReader.java:182)
        at com.googlecode.lanterna.input.InputDecoder.getNextCharacter(InputDecoder.java:144)
        at com.googlecode.lanterna.terminal.ansi.StreamBasedTerminal.readInput(StreamBasedTerminal.java:228)
        at com.googlecode.lanterna.terminal.ansi.StreamBasedTerminal.readInput(StreamBasedTerminal.java:207)
        at com.googlecode.lanterna.terminal.ansi.ANSITerminal.readInput(ANSITerminal.java:287)
        at com.googlecode.lanterna.terminal.TelnetTerminalTest$1.run(TelnetTerminalTest.java:70)
@avl42
Copy link
Contributor

avl42 commented Feb 27, 2021

As the committer of that change, you can be pretty sure, that it did work for me - back then :-)

@avl42
Copy link
Contributor

avl42 commented Feb 27, 2021

well, I see it now, too... can reproduce it ... will try to fix it...

@avl42
Copy link
Contributor

avl42 commented Feb 27, 2021

Back then I used eclipse... my eclipse machine is currently out of reach, so now I compiled and ran it on command line.

The strange thing is, that the "Read timed out" happens pretty instantly (in less than 20 milliseconds).
Maybe other Java implementations need some special stroking to get it working... or ...
I guess I need to get back to eclipse and see what it did differently, back then, than java
on command line does now.

@avl42
Copy link
Contributor

avl42 commented Mar 3, 2021

update: I got hold of my eclipse machine, and ... it does works there.
I will have to resort to other debugging tricks to fix it for plain Java...
It ain't ready until it runs in all the supported javas.

avl42 added a commit to avl42/lanterna that referenced this issue Apr 5, 2021
mabe02 added a commit that referenced this issue Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants