Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Address conversion with SOCKETS(BS2000)

&pagelevel(2)&pagelevel

In order to allow processes to communicate with one another on sockets, network addresses need to be determined and created. The SOCKETS(BS2000) library provides many different utility routines and macros for this purpose for the communications domains AF_INET and AF_INET6. These utility routines and macros are presented briefly in this chapter.
All utility routines are described in detail in the chapter “SOCKETS(BS2000) user functions”.

Before a client and server can communicate with each other, the client has to determine the service on the remote host. The following address conversion stages are required to determine the service concerned:

  1. A service and a host are each assigned names for better legibility at the user program level, e.g. the service login on host Monet.

  2. The system converts a service name to a service number (port number) and a host name to a network address (IPv4 or IPv6 address).

The following conversion functions are available:

  • host names to network addresses, and vice versa

  • network names to network numbers

  • protocol names to protocol numbers

  • service names to port numbers and the relevant protocol for communicating with the server

If you want to use one of these functions, you will need to include the <netdb.h> file. Program examples which use the conversion functions described below can be found in chapter “Client/server model with SOCKETS(BS2000)”.