Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Nov 1996 20:56:32 PST
From:      Bill Fenner <fenner@parc.xerox.com>
To:        compland@ism.com.br (Helio Coelho Jr. - CompuLand Informatica)
Cc:        hackers@freebsd.org, zyang01@fiu.edu
Subject:   Re: socket.h 
Message-ID:  <96Nov20.205644pst.177557@crevenia.parc.xerox.com>
In-Reply-To: Your message of "Wed, 20 Nov 96 16:26:01 PST." <199611210026.WAA15690@unix1.ism.com.br> 

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?96Nov20.205644pst.177557>