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