Defining server ports

From m204wiki
Jump to navigation Jump to search

Server ports

In order for a client application to communicate with a server application, it must have a way to identify the server application on the network. Under the TCP/IP protocols, the identity of a server has two parts. The first part identifies the machine on which the server runs. This part is called the machine's (or host's) IP address. The second part distinguishes the server application from other applications on the host. This part is called the port number.

A host's IP address is a 32-bit unsigned binary number that is displayed in "dotted" format, for example, To avoid having to refer to these types of addresses, most networks have nameservers or names files that map names to IP addresses. That way, a client application can connect to a host by a name (such as IBM3090) rather than by an address.

A port number is a number from 1 to 65535 that is assigned to every server application that is available on a host. In the case of Janus IFDIAL, the Janus server products (Janus Specialty Data Store, Janus Open Server, and Janus Web Server), and Janus server sockets, this port number is specified by the second parameter on the JANUS DEFINE command.

Since this port number must be unique for the host, it is impossible to start (JANUS START) a port with a port number that matches a port number for any other application running on the same host. This includes any Janus port on the same or a different Online that uses the same IP address. This also includes any other non-Janus server application. For example, port number 23 is almost always used by the telnet server. An attempt to start a Janus server for port number 23 will undoubtedly encounter a port-in-use situation and be unable to start.

On a system with several local server applications, or with more than one Online (maybe test and production) with several Janus ports, a simple strategy to keep port numbers from conflicting is to assign a range of ports to each Online. For example, port numbers 300-399 might be reserved for the test Online, and port numbers 400-499 might be reserved for the production Online.

The BINDADDR parameter of the JANUS DEFINE command also allows you to specify which IP address to use for a Janus server, if your operating system is configured to bind a port to one of multiple IP server addresses.

Sybase provides a way of mapping an application name to a host name (or address) and port number. This makes it possible to access a specific application by specifying only a single application name. This mapping is done through a mapping file called the "interfaces file" on Unix workstations, and through entries in WIN.INI or SQL.INI under Microsoft Windows. For more information on this mapping, refer to the Sybase DB/Library manuals.


A JANUS DEFINE command can do any one of the following:

A JANUS DEFINEREMOTE command can do any combination of the following:

  • Assign a remote host address and port number for Janus Open Client processing, and assign which local port numbers can call the remote host/port (non-INONLY).
  • Specify the address of a remote host and the Janus Open Server applications it may access (non-OUTONLY).

See also