Wizard-level questions

Kermit Tensmeyer tensmekl at infonode.ingr.com
Mon Jan 28 10:40:17 AEST 1991


In article <16048 at sdcc6.ucsd.edu> cs163wcr at sdcc10.ucsd.edu -- Steve Boswell writes:
>I have been hacking at these questions for a while, using various
>reference books, with no real progress.  Could someone please tell
>me:
>
>[2] With Internet sockets, how does a machine accept()ing a
>	socket connection know what machine is calling it?  Does
>	it rely on the calling program to tell it?
>
>I'm on 4.3 BSD Tahoe & the Internet, if that helps.
>
>Steve Boswell
>whatis at ucsd.edu

There is a function in the BSD suite of TCP/IP that has the following setup

	  int recvfrom (s, buf, len, flags, from, fromlen)
	    int s, len, flags;
	    char *buf;
	    struct sockaddr *from;
	    int *fromlen;

The structure Sockaddr contains the  return address (Type IV address and 
Port number from which is was sent. This of course works in the datagram
mode. When the connection is in the "connected mode" use the recv call.

For further information, look up recv(2) and connect(2) in the man pages.

---

   All the wizards that I used to know and from whom I learned my craft
   have seemed to have gotten out of the bussines. Most of the folk
   who are still willing to try know the areas of the business that
   have given them problems, .. there is just to much to know.


   The books on my desk that sometimes get open are:

   Maurice Bach		The Design of the UNIX Operating System

   Nemeth,Snyder,Seebass	Unix System Adminstration Handbook

   Egain, Teixeira	Writing A Unix Device Driver

   Schreiner		Using C with Curses, Lex, and Yacc

   Kochan, Wood		Unix Shell Programming

   Ellis, Stroustrup	The Annotated C++ Reference Manual

---
-- 
Kermit Tensmeyer                        | Intergraph Corporation
UUCP:     ...uunet!ingr!tensmekl	| One Madison Industrial Park
INTERNET: tensmekl at ingr.com		| Mail Stop LR23A2
AT&T:     (205)730-8127			| Huntsville, AL  35807-4201



More information about the Comp.unix.internals mailing list