[11] in 6.033-lab

home help back first fref pref prev next nref lref last post

Why bind_service wants a sockaddr, not a sockaddr_in

daemon@ATHENA.MIT.EDU (Kevin 'Bob' Fu)
Sat Mar 15 18:41:32 1997

To: 6.033-lab@MIT.EDU
Date: Sat, 15 Mar 1997 18:41:18 EST
From: Kevin 'Bob' Fu <fubob@MIT.EDU>


I asked this question (as did a couple others) and benjie replied.  We
thought this is useful to know.

Q. Why does bind_service want a (const struct sockaddr *) rather than
   a (struct sockaddr_in *) ?

A. ok, so sockaddr is the structure to use for all networking calls,
   because sockaddr_in is for inet and sockaddr_un is for unix (ipc), so
   if you use sockaddr, it is a generic call for everything.

--------
Kevin E. Fu aka Bob the BobOp         Athena OLC/RCC
PGP key: finger fubob@snafu.mit.edu   SIPB Member

home help back first fref pref prev next nref lref last post