Operating System - HP-UX
1825795 Members
3150 Online
109687 Solutions
New Discussion

Re: Socket implementation difference

 
Charles_151
Advisor

Socket implementation difference

Hi

Can anybody tell what are the socket implementation differences between hp 10.x and Solaris 9? Does this affect the application when I migrate from Hp to Solaris?
5 REPLIES 5
Stephen Keane
Honored Contributor

Re: Socket implementation difference

They are functionally equivalent. There are a few subtle differences though, off the top of my head* ...

1. The socket types are equivalent except that SOCK_SEQPACKET is not implemented on HP-UX.

2. The HP-UX version of accept(), when using address family of AF_CCITT, uses an x25addrstr structure for the second argument. The SunOS version of accept() uses a CONN_DB structure for the second argument in this situation.

3. HP-UX bind() does not return errors of EISDIR, EIO, ENOENT, EROFS or ELOOP.

4. If non-blocking I/O is enabled using O_NONBLOCK, O_NDELAY, or FIOSNBIO, and the connection cannot be completed immediately, HP-UX connect() will return a status of EINPROGRESS. SunOS incorrectly blocks until the connect call completes. Your SunOS code may be assuming the connect is complete.

5. HP-UX connect() does not return errors of EACCES, EIO, ENAMETOOLONG, ENOENT, ENOTDIR, EPROTOTYPE or ELOOP.

6. setsockname(2) and getsockname(2) do not accept SunOS options SO_OOBINLINE or SO_TYPE.

7. Non-blocking reads or writes using recv(2), recvfrom(2), recvmsg(2) send(2), sendto(2), or sendmsg(2) are configured differently between SunOS and HP-UX.

*See http://www.interex.org/tech/9000/Tech/sun_hpux_port/port7.html

for more details
Charles_151
Advisor

Re: Socket implementation difference

Stephen

Thanks for the information. This document I have seen already, but my doubt is that these differences are applicable for Solaris9?

Regards
Charles C.
Stephen Keane
Honored Contributor

Re: Socket implementation difference

Which bit do you have doubts over? I have access to a range of servers here, including Solaris 9, so I can check any specific concern you have.
Charles_151
Advisor

Re: Socket implementation difference

Stepahen

Can you please verify all bits.

It would be appreciate if you can provide standards (Socket) based difference also between Solaris9 and HP 10.x
rick jones
Honored Contributor

Re: Socket implementation difference

Under the covers, HP-UX 10 sockets and the TCP/IP stack were based on BSD code and had (mostly) BSD mannerisms. Initially, Solaris sockets were implemented as a library on top of TLI/XTI, but by Solaris 9 they are once again back in the kernel (perhaps by Solaris 8) however the stack is Streams based.

Tuning your Solaris 9 stack will be rather different from tuning your HP-UX 10 stack. I believe that in Solaris 9 there is still not an equivalent to the lanadmin command for link-level stats and it is still the "unsupported" netstat -k command.

If the source code to the netperf benchmark is any indication, for straightforward stuff, an application will behave just the same (ditto for HP-UX 11/11i for that matter)

Likely as not your HP-UX 10.X binaries will just run on HP-UX 11/11i - but I doubt they will run on Solaris 9 :) IIRC the compilers have differing levels of pickiness. There may be some differences simply because Solaris 9 is so much newer than HP-UX 10 - stuff like parameters to socket calls taking type socklen_t or the like.
there is no rest for the wicked yet the virtuous have no pillows