The Term Protocol
txconn is designed to ease the redirection of X applications from one host to another. If a user on computer2 wants to display an X application on your screen, you use txconn. Like using tredir, any incoming connections must use your remost host's name or IP address to connect to you.
Because X is outwardly different than normal TCP/IP clients, it needs special handling for redirection. By itself, txconn uses no command line arguments:
remotehost% txconn Xconn bound to screen 9 :9
This means that your home X display can be accessed from the network as remotehost:9, meaning root window 9 on the remotehost. If a user on computer2 wants to send his xclock to your local display, he would type:
computer2% setenv DISPLAY remotehost:9 computer2% xclock &
After a few moments, the xclock he executed will appear on your display.
If you want to display an X application running on your computer to computer2's display, you must use tredir. This is a bit confusing.
linuxbox% tredir 6004 computer2:6000 Redirecting 6004 to computer2:6000 linuxhox% export DISPLAY=localhost:4 linuxbox% xclock &
This may look a bit odd, but what you are doing is redirecting your display :4 (unused by you) to computer2's default display of :0. Ports 6000-6100 represent displays :0 to :100. By redirecting your own display :4 to his :0, any X application on your local machine which uses display :4 will appear on computer2's screen. It's a bit convoluted, but it works effectively.
Because of the nature of term, applications that work with standard TCP/IP will not work without the use of tredir, and even then, they may not always work. For example, it would be impossible to use tredir for an application like NCSA Mosaic because it makes so many different connections to different hosts and services. Other applications, though they use a single network connection, don't work because they use a secondary data port, such as ftp or IRC's DCC protocol. Applications such as this require modification of the actual source code to utilize the term socket. Most popular applications such as Mosaic, lynx, ftp, ncftp and irc have already been modified for use with the term protocol.
If you compile these applications yourself, they must be linked with the term library, libtermnet.a (This library has replaced the old client.a library.) This library contains the needed instructions and symbols for using the term socket.
New developments in term have made it extremely easy for users to modify existing TCP/IP applications for use with term, without the massive source code modifications that were once required. By using drop-in replacements for common socket/networking functions such as connect(), gethostbyname(), and send(),you need only modify the Makenle of an application to make it term-compliant. This drop-in replacement is the libtermnet.a library, and a header file which translates standard networking calls into term-compliant calls. One interesting note is that a termnet-linked binary also works with normal TCP/IP, so if you ever change to SLIP or PPP in the future, your term-compliant binaries will still work!
Only two elements are needed in the Makefile to make a term-compliant binary. In the location where the INCLUDES are defined, you add:
adapting the path for your term source path, of course.
And in the LIBS or LDFLAGS section, you add:
If you have libtermnet.a or the libtermnet.so.2.0.* shared library installed in a common library path, -L/directory/path isn't needed.
Hopefully, after adding these definitions, you end up with,` fully term-compliant binary. There are still a few shortfalls, of course. Many applications use non-standard socket calls, and termnet cannot fully control things like that. Also, the newly integrated (as I write) udp support in term is still very rough.
Applications such as Chimera, lynx, xarchie, rsh/rlogin and fsp are a few examples of successful tennnett~ng, and more are sure to follow.
With the implementation of termnet, the days of manual source-level hacking on most applications is over, and more and more applications that were once too hard to hand-patch term support into will be available to term users.
After term116, the term development was passed on to Bill Riemers (firstname.lastname@example.org). Major additions to term have been introduced, such as udp support, which is getting better and better, and shared libtermnet, which allows easy upgrading of term versions without recompiling term-compliant binaries every single time. The udp support has enabled such applications as ytalk, xarchie and fsp to Work through term.
There are still a lot of things to complete and improve with term, but it's a very successful and very useful tool for people who don't have the resources to run full-blown SLIP or PPP. It is very good, and can only get better.
Liem Bahneman is a student Unix consultant at the University of Washington and is the administrator of the Linux Organization WWW home page. Liem has heen using Linux and term for almost two years and in his free time develops X11 applications in C and tcl/tk.
Webinar: 8 Signs You’re Beyond Cron
On Demand NOW
Join Linux Journal and Pat Cameron, Director of Automation Technology at HelpSystems, as they discuss the eight primary advantages of moving beyond cron job scheduling. In this webinar, you’ll learn about integrating cron with an enterprise scheduler.View Now!
|My Humble Little Game Collection||May 28, 2015|
|New Linux Based OS Brings Internet of Things Closer to Reality||May 27, 2015|
|Non-Linux FOSS: All the Bitcoin, None of the Bloat||May 26, 2015|
|Dr Hjkl on the Command Line||May 21, 2015|
|Initializing and Managing Services in Linux: Past, Present and Future||May 20, 2015|
|Goodbye, Pi. Hello, C.H.I.P.||May 18, 2015|
- My Humble Little Game Collection
- New Linux Based OS Brings Internet of Things Closer to Reality
- Initializing and Managing Services in Linux: Past, Present and Future
- Dr Hjkl on the Command Line
- Using Hiera with Puppet
- Non-Linux FOSS: All the Bitcoin, None of the Bloat
- Infinite BusyBox with systemd
- Gartner Dubs DivvyCloud Cool Cloud Management Vendor
- Goodbye, Pi. Hello, C.H.I.P.
- It's Easier to Ask Forgiveness...