From owner-freebsd-hackers Wed Nov 20 20:57:52 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id UAA05128 for hackers-outgoing; Wed, 20 Nov 1996 20:57:52 -0800 (PST) Received: from alpha.xerox.com (alpha.Xerox.COM [13.1.64.93]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id UAA05122 for ; Wed, 20 Nov 1996 20:57:42 -0800 (PST) Received: from crevenia.parc.xerox.com ([13.2.116.11]) by alpha.xerox.com with SMTP id <15253(15)>; Wed, 20 Nov 1996 20:56:59 PST Received: from localhost by crevenia.parc.xerox.com with SMTP id <177557>; Wed, 20 Nov 1996 20:56:44 -0800 To: compland@ism.com.br (Helio Coelho Jr. - CompuLand Informatica) cc: hackers@freebsd.org, zyang01@fiu.edu Subject: Re: socket.h In-reply-to: Your message of "Wed, 20 Nov 96 16:26:01 PST." <199611210026.WAA15690@unix1.ism.com.br> Date: Wed, 20 Nov 1996 20:56:32 PST From: Bill Fenner Message-Id: <96Nov20.205644pst.177557@crevenia.parc.xerox.com> Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk You want to cast the sockaddr_in to a sockaddr, as in > if (connect(SocketDescriptor, (struct sockaddr *) &SocketInetAddr, >sizeof(SocketInetAddr)) < 0) You'll notice if you look carefully that "struct sockaddr" and "struct sockaddr_in" are the same size and the "family" and "length" fields overlap. I'd strongly reccommend "Unix Network Programming", by Richard Stevens, as a reference for networking programs like this. Bill