[Top] [Prev] [Next]

cs - connection server daemon



The connection server daemon, cs, is started by the cs command. The daemon monitors requests for interpretation of host names written by application programs to /net/cs, the interface file. After writing the request, the application reads that same file to obtain the response from the cs daemon.

The current implementation uses the hosting system's facilities for name-to-address and other conversions.

Request Format

Requests must be strings in the form:


Each component of the request is required.


The net component defines the network to be used (for example, tcp, udp). The special value net can be supplied to request the most expedient network.


Currently, net is synonymous with tcp.


The machine component can be any of the following
numeric internet address

Used verbatim.


Converted to network address.

symbolic server name of the form $server

Converted to hostname by reference to the connection server database file /services/cs/db. The hostname returned is then converted to an network address. No machine name is converted. Other conversions (for example, net and named services) are still done.


A service name or port number. The default is Styx
numeric port value

Used verbatim.

Service name

Converted to a port number.

Response Format

The application can obtain the converted address by reading the /net/cs interface file. The response will consist of two fields of the form:

	/net/net/clone			ipaddr!portno

The first field is the name of the file to open to reserve a connection on Inferno's IP device. The second field can be used to construct a connect message for the ctl file returned by the open of clone.


The service name to port number conversion is controlled by a <services> file. The location of that file is platform dependent:

Unix-hosted systems.


Windows-hosted systems


Applications that use a single file descriptor for both reading and writing should take care to reset the file offset to 0 between writing the request and reading the response. Otherwise, a truncated response will be read. Applications using buffered I/O should flush after resetting the offset.

Sometimes a hostname will resolve into several network addresses. The connection server provides all. Each read of /net/cs delivers one. The connection server caches this information until read; consequently, the application is obliged to read /net/cs in a loop until the end-of-file condition is reached. That means that all available addresses have been obtained and the daemon's cache for this request is empty.

See Also
cs - start connection server daemon in Chapter 5

seek - change file offset in Chapter 8

srv - miscellaneous services from the host operating system in Chapter 15

ip - TCP, UDP network protocols over IP in Chapter 2

Inferno Format Specifications in Appendix A

[Top] [Prev] [Next]

Copyright © 1996,Lucent Technologies, Inc. All rights reserved.