Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!munnari!moncskermit!basser!metro!ipso!sauron!shaun From: shaun@sauron.OZ (Shaun ARundell) Newsgroups: net.unix-wizards Subject: Socket Addresses Message-ID: <155@sauron.OZ> Date: Sat, 2-Aug-86 17:22:01 EDT Article-I.D.: sauron.155 Posted: Sat Aug 2 17:22:01 1986 Date-Received: Mon, 4-Aug-86 01:33:21 EDT Reply-To: shaun@sauron.UUCP (Shaun ARundell) Organization: Gould Electronics, CSD, Sydney, Australia Lines: 58 In have been working on a BSD4.3 ipc program and have come across a few things that puzzel me. The format for a socket address in is struct sockaddr { u_short sa_family; /* address family */ char sa_data[14]; /* up to 14 bytes of direct address */ }; May times I have seen a AF_UNIX address structure like struct sa { short family; char path[LARGE_NUMBER]; }; I take that this means that a socket address structure for AF_UNIX consists of a short (decribing the family) and as much data following that as you want. This would make sense. We all know (I think) that the socket system calls impose no address structure on the sockets but that different families expect there addresses in a certin formats. NOW - what can you say something like this server - s = socket(AF_UNIX, SOCK_STREAM, 0); ... bind(s, "server", sizeof( "server" ) ); ... listen(s, 5) ... accept(s, &from, &fromlen ); client - s = socket(AF_UNIX, SOCK_STREAM, 0 ); ... bind(s, "client", sizeof( "another_server" ) ); ... connect(s, "server" , sizeof("server") ); ... chat away socket ADDRESSES have me confused. Can any body clear up the confusion. \XX Shaun Arundell ARPA: munnari!sauron.oz!shaun@SEISMO \X Technical Support UUCP: seismo!munnari!sauron.oz!shaun XXXXX \XXXX GOULD COMPUTERS ACS: shaun@sauron.oz XXXXX /XXXX /X Telephone STD: (02) 957-2522 /XX ISD: +61 2 957-2522