public class TelnetTerminalServer extends Object
acceptConnection()
to wait for the next incoming connection, it will be returned as
a TelnetTerminal
object that represents the client and which will be the way for the server to send content
to this client. Next connecting client (through acceptConnection()
will get a different
TelnetTerminal
, i.e. their content will not be in sync automatically but considered as two different
terminals.TelnetTerminal
,
WikipediaConstructor | Description |
---|---|
TelnetTerminalServer(int port) |
Creates a new TelnetTerminalServer on a specific port
|
TelnetTerminalServer(int port,
Charset charset) |
Creates a new TelnetTerminalServer on a specific port, using a certain character set
|
TelnetTerminalServer(ServerSocketFactory serverSocketFactory,
int port) |
Creates a new TelnetTerminalServer on a specific port through a ServerSocketFactory
|
TelnetTerminalServer(ServerSocketFactory serverSocketFactory,
int port,
Charset charset) |
Creates a new TelnetTerminalServer on a specific port through a ServerSocketFactory with a certain Charset
|
Modifier and Type | Method | Description |
---|---|---|
TelnetTerminal |
acceptConnection() |
Waits for the next client to connect in to our server and returns a Terminal implementation, TelnetTerminal, that
represents the remote terminal this client is running.
|
void |
close() |
Closes the server socket, accepting no new connection.
|
ServerSocket |
getServerSocket() |
Returns the actual server socket used by this object.
|
public TelnetTerminalServer(int port) throws IOException
port
- Port to listen for incoming telnet connectionsIOException
- If there was an underlying I/O exceptionpublic TelnetTerminalServer(int port, Charset charset) throws IOException
port
- Port to listen for incoming telnet connectionscharset
- Character set to useIOException
- If there was an underlying I/O exceptionpublic TelnetTerminalServer(ServerSocketFactory serverSocketFactory, int port) throws IOException
port
- Port to listen for incoming telnet connectionsserverSocketFactory
- ServerSocketFactory to use when creating the ServerSocketIOException
- If there was an underlying I/O exceptionpublic TelnetTerminalServer(ServerSocketFactory serverSocketFactory, int port, Charset charset) throws IOException
serverSocketFactory
- ServerSocketFactory to use when creating the ServerSocketport
- Port to listen for incoming telnet connectionscharset
- Character set to useIOException
- If there was an underlying I/O exceptionpublic ServerSocket getServerSocket()
public TelnetTerminal acceptConnection() throws IOException
IOException
- If there was an underlying I/O exceptionpublic void close() throws IOException
IOException
- If there was an underlying I/O exceptionCopyright © 2020. All rights reserved.