X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fnet%2FTelnetSocket.java;h=ac8a2782b0ed672e2166026ffe46439a4bc2681b;hb=12b90437b5f22c2ae6e9b9b14c3b62b60f6143e5;hp=74ad72a3799e5dad860f94d15a29d0d5cee73b16;hpb=a2018e9964f6c58742cd1e6dd0a0c63e244a89d6;p=fanfix.git diff --git a/src/jexer/net/TelnetSocket.java b/src/jexer/net/TelnetSocket.java index 74ad72a..ac8a278 100644 --- a/src/jexer/net/TelnetSocket.java +++ b/src/jexer/net/TelnetSocket.java @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (C) 2017 Kevin Lamonte + * Copyright (C) 2019 Kevin Lamonte * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -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); + } + }