nvt4j

The Network Virtual Terminal for Java (NVT4J) is a library which can drive a terminal emulator connected to the application through a telnet session.

License

License

GroupId

GroupId

org.dellroad
ArtifactId

ArtifactId

nvt4j
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

nvt4j
The Network Virtual Terminal for Java (NVT4J) is a library which can drive a terminal emulator connected to the application through a telnet session.
Project URL

Project URL

https://github.com/archiecobbs/nvt4j
Source Code Management

Source Code Management

https://github.com/archiecobbs/nvt4j/

Download nvt4j

How to add to project

<!-- https://jarcasting.com/artifacts/org.dellroad/nvt4j/ -->
<dependency>
    <groupId>org.dellroad</groupId>
    <artifactId>nvt4j</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.dellroad/nvt4j/
implementation 'org.dellroad:nvt4j:1.2.0'
// https://jarcasting.com/artifacts/org.dellroad/nvt4j/
implementation ("org.dellroad:nvt4j:1.2.0")
'org.dellroad:nvt4j:jar:1.2.0'
<dependency org="org.dellroad" name="nvt4j" rev="1.2.0">
  <artifact name="nvt4j" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.dellroad', module='nvt4j', version='1.2.0')
)
libraryDependencies += "org.dellroad" % "nvt4j" % "1.2.0"
[org.dellroad/nvt4j "1.2.0"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 3.8.1

Project Modules

There are no modules declared in this project.

About

The Network Virtual Terminal for Java (NVT4J) is a library which can drive a terminal emulator connected to the application through a telnet session.

Current Status

This project was imported as an abandonded orphan from Google Code and given a new home here on Github on 17-Nov-2015.

Usage

The API consists of the interface Terminal. The implementation of this class is called TerminalImpl. To allow the user to connect to the application you need to listen for a tcp connection and then wrap a TerminalImpl object around it:

ServerSocket serverSocket = new ServerSocket(8000);
Socket socket = serverSocket.accept();
Terminal terminal = new TerminalImpl(socket);

For example, to run the sample class Example.java from an xterm session, you can do this:

user@localhost$ java -classpath nvt4j.jar Example &
user@localhost$ telnet localhost 8000

NVT4J uses the Telnet LINEMODE option to put the terminal driver (xterm in this case) in what the posix standard calls 'raw' or 'non-canonical' mode, so that it can receive all user inputs asap, instead of waiting for a new-line character.

Unfortunately in pure Java there is no way to put the operating system console in raw mode. On Linux and similar systems this is done using the stty command, which is a native program which manipulates the terminal driver in the operating system.

Downloads

See Downloads.

Documentation

View the Javadoc API.

License

See the LICENSE file.

Copyright 2006 Guglielmo Lichtner

Copyright 2015 Archie L. Cobbs

Versions

Version
1.2.0