wiki:ServerAddress

Version 15 (modified by ph3-der-loewe, 5 years ago) (diff)

better english

Server Address

The server address is the address the client uses to connect to the server. Depending on the used transport the address format is different.In common cases server auto locating is used and the server address is not given explicitly by the user. This page describes the format of the server address and how the auto locating works.

Address syntax

The syntax depends on the used transport. Some implementations do not support all transports. See NetworkMatrix for details on support of transports by implementations.

Type Syntax Defaults Notes
UNIX /path/to/socket ~/.roar, /tmp/roar Used if filename is a socket
DECnet node::obj, node::, ::obj, :: node: localnode, object: roar (none)
IPv4 hostname:port, hostname, ip:port, ip host: localhost, port: 16002 Usage of hostnames is recommended.
IPv6 hostname:port, hostname host: localhost, port: 16002 IPv6 addresses are not supported. Hostnames must be used.
Chardev /path/to/dev (none) Used if filename is a char device
Special +type (none) See list below

Special addresses

The following special addresses are assigned at the moment:

Address Parameter Supported by Description
+fork none libroar Fork a new server process only bound to this client.
d:Image libroar Set Image to start. This uses normal server arguments (works with both roard and µRoarD). Usefull to set a path for the server when not in $PATH
!cmd libroar Command to start server. This is interpreted as by the shell (first /bin/sh, then sh (from $PATH). Server needs to be connected to stdin/stdout. Example: +fork=!roard --no-listen --client-fh 0
+slp none libroar Use OpenSLP to locate the server.
+abstract none libroar, µRoar Address in abstract name space.
#Num Purposed Address in abstract name space with ID Num.
+invalid none libroar, µRoar An invalid address. This is to be used for testing.
+dstr DSTR String libroar This is a server type specific to libroar. It uses the DSTR API to open a server connection
+internal none libroar Connect to the current process. This is useful for plugins which can run within or outside of a server process
+default none libroar, µRoar Use default behavior (as if no address is given). This is useful to force the default behavior in applications not supporting NULL values.

More special addresses may be added later.

Auto locating of servers

To find a server the client (library) tries several locations. The table below lists the recommended steps to locate the server. Implementations may behave differently.

When a step do not result in a valid address the next step is processed. The column "Continue when failed" indicates if the next step is also processed when the step resulted in a valid server address but the server was unreachable.

# Step Continue Supported by Description
when failed libroar µRoar
0 Server given by application/user No Yes Yes This is the address given directly to the open function
1 Server given by application default No Yes No This address is the application's default
2 $ROAR_SERVER No Yes Yes Server address given by environment
3 Server in Display's ROAR_SERVER-prop No Yes No Server set in X11 servers ROAR_SERVER property or similar for other windowing environments
4 /etc/roarserver No Yes Yes This is a symlink to the server address. It is ready with readlink().
5 Server: ~/.roar Yes Yes Yes
6 Server: /tmp/roar Yes Yes Yes
7 Server: localhost:roar Yes Yes Yes
8 Server: localnode::roar Yes Yes Yes
9 Server: +abstract Yes Yes Yes
10 OpenSLP (with cache) Yes Yes No Locate a server using OpenSLP. Local cache enabled.
11 OpenSLP (without cache) Yes Yes No Locate a server using OpenSLP. Local cache disabled to force fresh lookup.
-- Retries some of the above Yes Yes -- This is specific to libroar
12 Client address from SSH environment Yes Yes No This the first part of $SSH_CLIENT and $SSH_CONNECTION
-- Retries some of the above Yes Yes -- This is specific to libroar
-- Server: /tmp/muroard Yes Yes -- This is specific to libroar
13 Try all DECnet neighbours Yes Yes No
14 Try all IP neighbours Yes Yes No IP neighborhood table is also known as ARP table
15 All Nodes in local node database Yes No No On GNU/Linux this file is /etc/decnet.conf
16 All Hosts in local host database Yes No No On most systems this file is /etc/hosts
17 All Nodes in local ether database Yes No No On most systems this file is /etc/ethers