home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / protocol / tcpip / 5599 < prev    next >
Encoding:
Text File  |  1992-12-13  |  1.1 KB  |  54 lines

  1. Newsgroups: comp.protocols.tcp-ip
  2. Path: sparky!uunet!destroyer!gumby!wmu-coyote!rustomji
  3. From: rustomji@sol.cs.wmich.edu (Eric Rustomji)
  4. Subject: Help: getpeername(), getsockname() calls
  5. Message-ID: <1992Dec13.183114.9239@sol.cs.wmich.edu>
  6. Keywords: SOCKET SYSTEM CALLS
  7. Organization: Western Michigan University
  8. Distribution: usa
  9. Date: Sun, 13 Dec 1992 18:31:14 GMT
  10. Lines: 42
  11.  
  12. Hi there,
  13.  
  14. I was trying to use the BSD socket calls, on my client-server
  15. project:
  16.  
  17. getpeername(s, name, namelen)
  18. int s;
  19. struct sockaddr *name;
  20. int *namelen;
  21.  
  22. where, I allocated:
  23. struct sockaddr clnt_name;
  24. int clnt_name_len;
  25.  
  26. main()
  27. {
  28.     .
  29.     .
  30.     clnt_name_len = sizeof(clnt_name);
  31.     getpeername(sockfd, &clnt_name, &clnt_name_len);
  32.     .
  33.     .
  34. }
  35.  
  36. I observed that after the getpeername() call, the variable clnt_name
  37. contains this:
  38.  
  39. clnt_name.sa_family = 2
  40. clnt_name.sa_data = "p ( >"   --->> ????
  41.  
  42. Could anyone let me know, whats happening here. I dont seem to
  43. be getting the endpoint connection/remote address of the socket.
  44.  
  45. I would appreciate if any ideas/reference could be sent to me ASAP
  46. at my email address: 
  47. rustomji@cs.wmich.edu
  48.  
  49. Thanks a bunch! Happy Holidays !!
  50.  
  51. --
  52. Eric
  53.  
  54.