Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)

11 Porting or Migrating Sockets Applications
This chapter discusses the following topics:
“Porting UNIX Sockets Applications to the OSS Environment” (page 178)
“Porting Guardian Sockets Applications to the OSS Environment” (page 180)
“Interoperability of OSS and Guardian Sockets in an OSS Application” (page 184)
Porting UNIX Sockets Applications to the OSS Environment
The following topics are discussed in this subsection:
“General Considerations” (page 178)
“Differences Between OSS Sockets and Berkeley Software Distribution Sockets” (page 179)
“Porting Situations” (page 180)
Additional considerations and sample programs can be found in the Open System Services
Programmer’s Guide.
General Considerations
The following is a list of general considerations for porting a sockets program from a UNIX system
to the OSS environment:
Errors with the same names are compatible from UNIX to OSS sockets routines. UNIX and
OSS sockets routine error numbers are not the same. UNIX programs that refer to errors by
number must be converted to refer to errors by name.
The socketpair() function cannot be used with the AF_INET or AF_INET6 domain.
OSS sockets programs cannot currently receive SIGIO signals.
OSS supports multiple transport provider processes on one node for AF_INET and AF_INET6
sockets. If a processor has multiple IP addresses, you can specify which transport provider
process to use by setting the DEFINE =TCPIP^PROCESS^NAME or by calling the
socket_transport_name_set() function within the application.
A specified AF_INET or AF_INET6 transport provider process must be a TCP/IP process
running on the same node as the application. The default AF_INET transport provider process
is $ZTC0. An alternate transport provider process can be named by setting the Guardian
MAP DEFINE =TCPIP^PROCESS^NAME for the sockets application before starting the
application or by calling the socket_transport_name_set() function while the application
is running. The current transport provider process name can be determined by calling the
socket_transport_name_get() function. If you want to use Parallel Library TCP/IP or
NonStop TCP/IPv6, use one of these methods to specify a TCPSAM or TCP6SAM process
name for the transport service provider. For information about how to determine the name of
a TCPSAM or TCP6SAM process, refer to the TCP/IP (Parallel Library) Configuration and
Management Manual or the TCP/IPv6 Configuration and Management Manual.
HP does not support changing the transport provider process for AF_UNIX Release 1 sockets.
The default transport provider process for AF_UNIX sockets is $ZPLS.
For systems running AF_UNIX Release 2 software, sockets are created in compatibility mode
if the transport-provider name is $ZPLS and portability mode if the transport-provider name is
$ZAFN2. The default transport-provider name is $ZPLS. The alternate transport-provider name,
$ZAFN2, can be named by setting the Guardian MAP DEFINE =_AFUNIX_PROCESS_NAME
or by calling the socket_transport_name_set() function. The current transport-provider
name can be determined by calling the socket_transport_name_get() function.
178 Porting or Migrating Sockets Applications