home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / hp / 13103 < prev    next >
Encoding:
Internet Message Format  |  1992-11-19  |  1.6 KB

  1. Path: sparky!uunet!mcsun!uknet!cam-eng!tpl
  2. From: tpl@eng.cam.ac.uk (Tim Love)
  3. Newsgroups: comp.sys.hp
  4. Subject: SUN <-> HP and sockets
  5. Message-ID: <1992Nov19.141426.16824@eng.cam.ac.uk>
  6. Date: 19 Nov 92 14:14:26 GMT
  7. Organization: cam.eng
  8. Lines: 48
  9.  
  10. We have been trying to get HP 9000/3xx machines running hpux8 and Suns 
  11. to talk to each other using BSD datagram sockets over UDP/IP.
  12.  
  13. HP client sockets are bound as -
  14.     memset ((char *) &cli_addr, 0, sizeof(cli_addr));
  15.     cli_addr.sin_family         = AF_INET;
  16.     cli_addr.sin_addr.s_addr    = htonl(INADDR_ANY); 
  17.     cli_addr.sin_port         = htons(0);
  18.  
  19.     if (bind(sockfd, (struct sockaddr_in  *) &cli_addr, 
  20.             sizeof(cli_addr)) < 0) {
  21.         printf("\nCan't bind socket\n");
  22.         return(-1);
  23.     }
  24.  
  25. Sun server addresses are specified by -
  26.     serv_addr.sin_family         = AF_INET;
  27.     serv_addr.sin_addr.s_addr    = inet_addr(SERV_HOST_ADDR);
  28.     serv_addr.sin_port        = htons((u_short) dstkey);
  29. where SERV_HOST_ADDR and dstkey are hardwired at present. 
  30.  
  31. Messages are sent and received using the sendto and recvfrom calls -
  32.  
  33.     if (sendto(sockfd, buf, nbytes, 0, 
  34.             (struct sockaddr *) &serv_addr, svrlen) != nbytes)
  35.         syserr("Unable to send datagram to BB server");
  36.     .
  37.     .
  38.     .
  39.  
  40.     n = recvfrom(sockfd, inbuf, nbytes, 0, 
  41.                 (struct sockaddr *) 0, (int *) 0);
  42.     if (n < 0) {
  43.             .
  44.         [retranmission code]
  45.             .
  46.  
  47. The problem is that the HP client can send to the Sun server o.k but does not 
  48. receive acknowledgements. The Sun definitely receives HP messages and replies
  49. to them though.
  50.  
  51. This code works fine when both client and server are Sun m/cs running SunOs 
  52. 4.1.1. We haven't tried installing the server on an HP yet.
  53.  
  54. Any known problems in this area? 
  55.  
  56.  
  57. Tim Love (tpl@eng.cam.ac.uk)
  58.