[comp.sys.hp] Socket stuff

kong@ucla-cs.UUCP (06/15/87)

Do anyone out there know the differences between the BSD socket and
the socket stuff on HP 9000/320 running HP-UX 5.17 ? 

According to the manual pages, it seems to me that they are the same, but
when I try to install some software which use socket to communicate between
an HP and another machine running XENIX (3.4), it fails (It works between
VAX BSD 4.3 and XENIX).

Any hint will be appreciated. Thanks in advance.

'Kong
UUCP : ..!{sdcrdcf,ihnp4,cepu,trwspp,ucbvax}!ucla-cs!kong
ARPA : kong@cs.ucla.edu 

jin@hplabsc.UUCP (06/17/87)

In article <6644@shemp.UCLA.EDU> kong@CS.UCLA.EDU (Kong Li) writes:
>Do anyone out there know the differences between the BSD socket and
>the socket stuff on HP 9000/320 running HP-UX 5.17 ? 
>
>According to the manual pages, it seems to me that they are the same, but
>when I try to install some software which use socket to communicate between
>an HP and another machine running XENIX (3.4), it fails (It works between
>VAX BSD 4.3 and XENIX).

Can you be more precise as to what did not work?

kong@CS.UCLA.EDU (06/18/87)

In article <2032@hplabsc.UUCP> jin@hplabsc.UUCP (Tai Jin) writes:
>Can you be more precise as to what did not work?

The problem occurs when two processes on the HP try to communicate with
each other by socket (NOT between the HP and the intel System 310 :-), actually
the connection between the HP and the intel System 310 is successful).
          dsoc = socket(AF_INET,SOCK_STREAM,0);
          ...
          setsockopt(dsoc, SOL_SOCKET, SO_REUSEADDR,...);
          ...
          connect(dsoc, (struct *)&his_addr, sizeof(his_addr));
          ...
but the connection fails. The errno tells me "Connection refused".
But the same code works on the VAX BSD 4.3, any clues ? 

'Kong
UUCP : ..!{sdcrdcf,ihnp4,cepu,trwspp,ucbvax}!ucla-cs!kong
ARPA : kong@cs.ucla.edu 

jin@hplabsc.UUCP (Tai Jin) (06/19/87)

In article <6743@shemp.UCLA.EDU> kong@CS.UCLA.EDU (Kong Li) writes:
>The problem occurs when two processes on the HP try to communicate with
>each other by socket (NOT between the HP and the intel System 310 :-), actually
>the connection between the HP and the intel System 310 is successful).
>          dsoc = socket(AF_INET,SOCK_STREAM,0);
>          ...
>          setsockopt(dsoc, SOL_SOCKET, SO_REUSEADDR,...);
>          ...
>          connect(dsoc, (struct *)&his_addr, sizeof(his_addr));
>          ...
>but the connection fails. The errno tells me "Connection refused".
>But the same code works on the VAX BSD 4.3, any clues ? 

I assume the peer process did a corresponding socket(), bind(), listen(),
accept() sequence.  By the way, why do you do a setsockopt() on the connect
socket?  You normally do it on the bind socket.  Unless there's a reason for
it, remove it.

Anyway, that errno tells me that the server wasn't listening on the particular
port you were trying to connect to.  After you've started the server process,
do a "netstat -a" to see if it's there.  Make sure that the port and address
in the "his_addr" struct are correct.

 ...tai