X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fnet%2FTelnetSocket.java;h=34e715f34037c556f78dcde4f0851595b9906d39;hb=051e29138b18fb4b731a72f8727475b10e4c74e4;hp=74ad72a3799e5dad860f94d15a29d0d5cee73b16;hpb=a2018e9964f6c58742cd1e6dd0a0c63e244a89d6;p=nikiroo-utils.git diff --git a/src/jexer/net/TelnetSocket.java b/src/jexer/net/TelnetSocket.java index 74ad72a..34e715f 100644 --- a/src/jexer/net/TelnetSocket.java +++ b/src/jexer/net/TelnetSocket.java @@ -38,17 +38,11 @@ import java.net.Socket; * establish an 8-bit clean no echo channel and expose window resize events * to the Jexer ECMA48 backend. */ -public final class TelnetSocket extends Socket { +public class TelnetSocket extends Socket { - /** - * The telnet-aware socket InputStream. - */ - private TelnetInputStream input; - - /** - * The telnet-aware socket OutputStream. - */ - private TelnetOutputStream output; + // ------------------------------------------------------------------------ + // Constants -------------------------------------------------------------- + // ------------------------------------------------------------------------ // Telnet protocol special characters. Note package private access. static final int TELNET_SE = 240; @@ -71,6 +65,21 @@ public final class TelnetSocket extends Socket { static final int C_LF = 0x0A; static final int C_CR = 0x0D; + // ------------------------------------------------------------------------ + // Variables -------------------------------------------------------------- + // ------------------------------------------------------------------------ + + /** + * The telnet-aware socket InputStream. + */ + private TelnetInputStream input; + + /** + * The telnet-aware socket OutputStream. + */ + private TelnetOutputStream output; + + /** * If true, this is a server socket (i.e. created by accept()). */ @@ -126,14 +135,9 @@ public final class TelnetSocket extends Socket { */ String terminalSpeed = ""; - /** - * See if telnet server/client is in ASCII mode. - * - * @return if true, this connection is in ASCII mode - */ - public boolean isAscii() { - return (!binaryMode); - } + // ------------------------------------------------------------------------ + // Constructors ----------------------------------------------------------- + // ------------------------------------------------------------------------ /** * Creates a Socket that knows the telnet protocol. Note package private @@ -145,7 +149,9 @@ public final class TelnetSocket extends Socket { super(); } - // Socket interface ------------------------------------------------------- + // ------------------------------------------------------------------------ + // Socket ----------------------------------------------------------------- + // ------------------------------------------------------------------------ /** * Returns an input stream for this socket. @@ -181,4 +187,17 @@ public final class TelnetSocket extends Socket { return output; } + // ------------------------------------------------------------------------ + // TelnetSocket ----------------------------------------------------------- + // ------------------------------------------------------------------------ + + /** + * See if telnet server/client is in ASCII mode. + * + * @return if true, this connection is in ASCII mode + */ + public boolean isAscii() { + return (!binaryMode); + } + }