home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / question / 15300 < prev    next >
Encoding:
Text File  |  1993-01-07  |  1.0 KB  |  27 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!cs.utexas.edu!torn!mcshub!maccs!cs4gp6bl
  3. From: cs4gp6bl@maccs.mcmaster.ca (Kerr         P)
  4. Subject: How do you find out if tcp sock conn is local/remote?
  5. Message-ID: <1993Jan7.232856.15037@mcshub.dcss.mcmaster.ca>
  6. Sender: usenet@mcshub.dcss.mcmaster.ca
  7. Nntp-Posting-Host: maccs.dcss.mcmaster.ca
  8. Organization: Department of Computer Science, McMaster University
  9. Date: Thu, 7 Jan 1993 23:28:56 GMT
  10. Lines: 15
  11.  
  12. Hiya!
  13.  I am having some problems trying to find out if a socket connection
  14. I have just accept(ed) is coming from a remote machine or is local.
  15.  
  16.  I assume the address of the remote end of the socket is in the 
  17. sin_addr field of the sockaddr structure that the accept has been
  18. made on but I have been unable to properly get the ip address to 
  19. compare with ip address of the machine the server code is running on.
  20.  
  21.  I have looked at the manuals and a few different books but have found
  22. no reference on how to !properly! do this. If anyone could provide some
  23. insight it would be greatly appreciated.
  24.  
  25.         Cheers, Paul
  26.  
  27.