xpans: the XPA Name Server

Summary

  xpans [-h] [-e] [-k sec] [-p port] [-l log] [-s security log] [-P n]

  -h		print help message
  -e		exit when there are no more XPA connections
  -k		send keepalive messages every n sec
  -l		log data base entries to specified file
  -p		listen for connections on specified port
  -s		log security info for each connection to specified file      
  -P 		accept proxy requests (P=1) using separate thread (P=2)
  --version     display version and exit

The xpans name server is an XPA-enabled program that is used to manage the names and ports of XPA access points. It is started automatically when an XPA access point is registered. You can access the name server using xpaget to get a list of registered access points.

The xpans name server provides a crucial link between XPA clients and servers. When an XPA server defines an access point using XPANew(), XPACmdNew(), or XPAInfoNew(), the name of the access point is registered in the name service, along with connection information. The name server then matches class:name templates passed to it by XPA clients with these registered entries, so that the clients can communicate with the appropriate servers.

The socket connection between an XPA-enabled program and xpans is kept open until the former exits (or explicitly closes the connection). Apparently, some Internet equipment (e.g. DSL modems) can cause such a connection to time-out after a period of inactivity. To prevent this from happening, you can use the -k [sec] switch to send a short keep-alive message to each open connection after the specified time delay. (Note that this application level use of keep-alive is necessary only if you are serving XPA-enabled clients over the Internet and have to deal with long-term connections involving DSL or similar equipment. XPA uses the ordinary socket-level keep-alive, which works for all other cases.) NB (12/2/2009): Out-of-band (URG) TCP data, used by xpans keep-alive, is changed by some Cisco routers into in-band data. Encountering such a router will break the keep-alive function and may break your XPA server as well. Proceed with caution!

The xpans program will be started automatically (assuming it can be found in the user's path) when the first XPA access point is registered. It therefore need not be started explicitly. However, when started automatically, the -e switch is used, so that the name server will exit when there are no more XPA access points registered. If you wish to keep the name server running continually, simply start it manually without the -e switch.

The name server will keep a log of registered access points if the -l [log] switch is used on the command line (this is the case for automatic start-up). The log contains enough name and connection information to allow you to re-register all XPA access points in case the name server process is terminated prematurely. For example, after the ds9 access point is registered,the log will contain the entry:

  add 838e2f67:1863 ds9 ds9 gs eric
If xpans is terminated but ds9 still is running, you can re-register both access points for the ds9 process by running:
  xpaset -p 838e2f67:1863 -nsconnect
Notice that the ip:port specifier is used with xpaset to bypass the need for contacting the name server (which does not have the name registered yet!)

The name server will keep a log of security information if the -s [security log] switch is used on the command line. For each accepted connection, (including connections via the xpaget command), information will be logged about the host issuing the command and the parameters passed into the program. This is most useful when xpans is accepting connections from untrusted machines.

When an XPA access point is removed by a server using XPAFree(), the access information is removed from the name server. If an XPA-enabled process is terminated, all names registered by that process will be removed automatically. The log file is always updated to reflect the currently registered access points.

The name server itself has an XPA access point names xpans registered through which you can find out information about currently registered access points (assuming you have access to the name server; see XPA Access Control for more information). For each registered access point, the following information is returned:

  class		# class of the access point
  name		# name of the access point
  access	# allowed access (g=xpaget,s=xpaset,i=xpainfo)
  id		# socket access method (host:port for inet, file for local/unix)
  user		# user name of access point owner

For example, to display all currently registered access points, simply execute:

  xpaget xpans
Continuing the example of ds9 above, this will return:
  DS9 ds9 gs 838e2f67:1863 eric
If the same program has been started with different XPA access names, you can look up only names matching a specified template. For example, assume that ds9 has been started up using:
  ds9 &
  ds9 -title ds9-1-eric &
  ds9 -title ds9-2-eric &
To lookup all ds9 access points which end in ".eric" and which can be accessed using xpaset, use:
  xpaget xpans "DS9:*.eric" "s" "*"
This will return:
  DS9 ds9-2-eric gs 838e29d3:42102 eric
  DS9 ds9-1-eric gs 838e29d3:42105 eric
The third argument "*" requests all access points from all users. You also can specify a specific user name and only access points registered by that user will be returned.

The name server uses the XPA_METHOD environment variable to determine whether it should listen for requests on INET or LOCAL sockets. Since XPA access points also use this environment variable, the choice of socket method will be consistent. Note that, when INET sockets are used, a local server can be accessed from remote machines if the XPA_NSINET environment variable is set to point to the local machine. See XPA Environment Variables for more information.

An experimental feature of xpans is its ability to act as a proxy to XPA servers behind firewalls that want to communicate with external processes. The basic idea is the following: an XPA server (call it "foo") on host1, possibly behind a firewall, makes a remote connection to a proxy-enabled xpans program on host2 (specifying host2's XPA method). For example:

  xpaset -p foo -remote 'host2:28571' + -proxy   # on host1
When this is done, host2 can use xpaset, xpaget, and xpainfo calls to communicate with the XPA server foo. All command communication is performed via the xpans socket connection between foo on host1 and xpans on host2 (which was initiated by foo from inside the firewall). Data communication is similarly performed using a socket connection initiated on host1 (usually with a port value two greater than the port value of the main xpans socket connection). An xpaset or xpaget call on host2 contacts xpans, which performs an XPASet() or XPAGet() call to foo, passing commands and data back and forth between the two programs.

By default, proxy connections are not allowed by xpans. If the -P switch is specified with a value of 1, proxy connection are allowed, but all proxy communication is performed in the same thread as xpans processing. If a value of 2 is specified, the proxy processing is performed in a separate thread (assuming pthreads are supported on your system). Because xpa callback processing of any type can take a long time and therefore can interfere with normal xpans processing, threaded proxy connections (-P 2) are recommended. When using proxy connections, it might also be useful to set the XPA_IOCALLSXPA environment variable, so that multiple proxy requests can be handled at the same time, instead of serially.

Note that this proxy interface to xpans is experimental. It is used to provide remote data analysis capabilities on the Chandra-Ed system using ds9. (See http://chandra-ed.cfa.harvard.edu and http://hea-www.harvard.edu/saord/ds9 for more details). As always, please contact us if you have problems or questions.

Go to XPA Help Index

Last updated: January 24, 2005
on> Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful.
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-08-31 15:19:35 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-08-31 15:19:35 (GMT)
commit9a9b0aefb8d903006586c7445a843656fe45107f (patch)
tree1bef5c1caca0c9ba498f26d4ab155eed6ac330b9
parent2dff694c415bcb05ec35723e1d67c61c07d7bfaa (diff)
downloadtcl-9a9b0aefb8d903006586c7445a843656fe45107f.zip
tcl-9a9b0aefb8d903006586c7445a843656fe45107f.tar.gz
tcl-9a9b0aefb8d903006586c7445a843656fe45107f.tar.bz2
Grammar and spelling fixes. [Patch 1018486]
Diffstat
-rw-r--r--ChangeLog9
-rw-r--r--doc/binary.n6
-rw-r--r--doc/catch.n4
-rw-r--r--doc/clock.n18
-rw-r--r--doc/dde.n4
-rw-r--r--doc/exec.n21
-rw-r--r--doc/file.n4
-rw-r--r--doc/format.n4
-rw-r--r--doc/history.n4
-rw-r--r--doc/http.n47
-rw-r--r--doc/info.n8
-rw-r--r--doc/linsert.n4
-rw-r--r--doc/lsearch.n4
-rw-r--r--doc/lsort.n4
-rw-r--r--doc/msgcat.n10
-rw-r--r--doc/namespace.n30
-rw-r--r--doc/pid.n4
-rw-r--r--doc/registry.n4
-rw-r--r--doc/socket.n4
-rw-r--r--doc/trace.n10
-rw-r--r--generic/tclVar.c130
21 files changed, 227 insertions, 106 deletions
diff --git a/ChangeLog b/ChangeLog
index a0ba17d..5137f48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-08-31 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * doc/trace.n, doc/socket.n, doc/registry.n, doc/pid.n:
+ * doc/namespace.n, doc/msgcat.n, doc/lsort.n, doc/lsearch.n:
+ * doc/linsert.n, doc/info.n, doc/http.n, doc/history.n:
+ * doc/format.n, doc/file.n, doc/exec.n, doc/dde.n, doc/clock.n:
+ * doc/catch.n, doc/binary.n: More spelling and grammar fixes from
+ Mikhail Kolesnitchenko. [Patch 1018486]
+
2004-08-31 Vince Darley <vincentdarley@users.sourceforge.net>
* doc/FileSystem.3:
diff --git a/doc/binary.n b/doc/binary.n
index 08ca0a0..2c66eef 100644
--- a/doc/binary.n
+++ b/doc/binary.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: binary.n,v 1.19 2004/06/15 22:22:37 dkf Exp $
+'\" RCS: @(#) $Id: binary.n,v 1.20 2004/08/31 15:19:35 dkf Exp $
'\"
.so man.macros
.TH binary n 8.0 Tcl "Tcl Built-In Commands"
@@ -22,7 +22,7 @@ binary \- Insert and extract fields from binary strings
.PP
This command provides facilities for manipulating binary data. The
first form, \fBbinary format\fR, creates a binary string from normal
-Tcl values. For example, given the values 16 and 22, on a 32 bit
+Tcl values. For example, given the values 16 and 22, on a 32-bit
architecture, it might produce an 8-byte binary string consisting of
two 4-byte integers, one for each of the numbers. The second form of
the command, \fBbinary scan\fR, does the opposite: it extracts data
@@ -700,7 +700,7 @@ floating point representations.
.IP \fBx\fR 5
Moves the cursor forward \fIcount\fR bytes in \fIstring\fR. If
\fIcount\fR is \fB*\fR or is larger than the number of bytes after the
-current cursor cursor position, then the cursor is positioned after
+current cursor position, then the cursor is positioned after
the last byte in \fIstring\fR. If \fIcount\fR is omitted, then the
cursor is moved forward one byte. Note that this type does not
consume an argument. For example,
diff --git a/doc/catch.n b/doc/catch.n
index 65a184c..cc5d4bc 100644
--- a/doc/catch.n
+++ b/doc/catch.n
@@ -6,7 +6,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: catch.n,v 1.9 2004/03/16 22:19:43 dgp Exp $
+'\" RCS: @(#) $Id: catch.n,v 1.10 2004/08/31 15:19:35 dkf Exp $
'\"
.so man.macros
.TH catch n "8.5" Tcl "Tcl Built-In Commands"
@@ -28,7 +28,7 @@ regardless of any errors that might occur while executing \fIscript\fR.
If \fIscript\fR raises an error, \fBcatch\fR will return a non-zero integer
value corresponding to the exceptional return code returned by evaluation
of \fIscript\fR. Tcl defines the normal return code from script
-evalation to be zero (0), or TCL_OK. Tcl also defines four exceptional
+evaluation to be zero (0), or TCL_OK. Tcl also defines four exceptional
return codes: 1 (TCL_ERROR), 2 (TCL_RETURN), 3 (TCL_BREAK),
and 4 (TCL_CONTINUE). Errors during evaluation of a script are indicated
by a return code of TCL_ERROR. The other exceptional return codes are
diff --git a/doc/clock.n b/doc/clock.n
index 31b919c..175a82f 100644
--- a/doc/clock.n
+++ b/doc/clock.n
@@ -46,7 +46,7 @@ is synonymous with \fBclock milliseconds\fR (see below). This
usage is obsolete, and \fBclock milliseconds\fR is to be
considered the preferred way of obtaining a count of milliseconds.
.sp
-It the \fI-option\fR argument is \fI-microseconds\fR, then the command
+If the \fI-option\fR argument is \fI-microseconds\fR, then the command
is synonymous with \fBclock microseconds\fR (see below). This
usage is obsolete, and \fBclock microseconds\fR is to be
considered the preferred way of obtaining a count of microseconds.
@@ -728,10 +728,10 @@ that give the rules for various locales. A complete list
of the location names is too lengthy to be listed here.
On most Tcl installations, the definitions of the locations
are to be found in named files in the directory
-"\fI/no_backup/tools/lib/tcl8.5/clock/tzdata\fR". On some Unix systems, these
+ "\fI/no_backup/tools/lib/tcl8.5/clock/tzdata\fR". On some Unix systems, these
files are omitted, and the definitions are instead
obtained from system files in "\fI/usr/share/zoneinfo\fR",
-"\fI/usr/share/lib/zoneinfo\fR" or "\fI/usr/local/etc/zoneinfo\fR".
+ "\fI/usr/share/lib/zoneinfo\fR" or "\fI/usr/local/etc/zoneinfo\fR".
As a special case, the name \fB:localtime\fR refers to
the local time zone as defined by the C library.
.PP
@@ -794,9 +794,12 @@ a 24-hour clock.
.TP
\fIdate\fR
A specific month and day with optional year. The
-acceptable formats are "\fBmm/dd?/yy?\fR", "\fBmonthname dd?, yy?\fR",
-"\fBday, dd monthname ?yy?\fR", "\fBdd monthname yy\fR",
-"\fB?CC?yymmdd\fR", and "\fBdd-monthname-?CC?yy\fR.
+acceptable formats are "\fBmm/dd\fR?\fB/yy\fR?",
+ "\fBmonthname dd\fR?\fB, yy\fR?",
+ "\fBday, dd monthname \fR?\fByy\fR?",
+ "\fBdd monthname yy\fR",
+ "?\fBCC\fR?\fByymmdd\fR", and
+ "\fBdd-monthname-\fR?\fBCC\fR?\fByy\fR".
The default year is the current year. If the year is less
than 100, we treat the years 00-68 as 2000-2068 and the years 69-99
as 1969-1999. Not all platforms can represent the years 38-70, so
@@ -827,7 +830,7 @@ differences and the correct date is given when going from the end
of a long month to a short month.
.PP
Daylight savings time correction is applied only when the relative time
-is specified in units of days or more, ie, days, weeks, fortnights, months or
+is specified in units of days or more, i.e.\ days, weeks, fortnights, months or
years. This means that when crossing the daylight savings time boundary,
different results will be given for \fBclock scan "1 day"\fR and
\fBclock scan "24 hours"\fR:
@@ -841,4 +844,3 @@ different results will be given for \fBclock scan "1 day"\fR and
msgcat
.SH "COPYRIGHT"
Copyright (c) 2004 Kevin B. Kenny <kennykb@acm.org>. All rights reserved.
-
diff --git a/doc/dde.n b/doc/dde.n
index ac9f9a3..2f46adb 100644
--- a/doc/dde.n
+++ b/doc/dde.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: dde.n,v 1.13 2004/05/25 21:06:41 dkf Exp $
+'\" RCS: @(#) $Id: dde.n,v 1.14 2004/08/31 15:19:36 dkf Exp $
'\"
.so man.macros
.TH dde n 1.2 dde "Tcl Bundled Packages"
@@ -58,7 +58,7 @@ unique. The command's result will be the name actually used. The
\fI-force\fR option is used to force registration of precisely the
given \fItopic\fR name.
.IP
-The \fI-handler\fR option specifies a tcl procedure that will be called to
+The \fI-handler\fR option specifies a Tcl procedure that will be called to
process calls to the dde server. If the package has been loaded into a
safe interpreter then a \fI-handler\fR procedure must be defined. The
procedure is called with all the arguments provided by the remote
diff --git a/doc/exec.n b/doc/exec.n