This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Ecos-Socket Error
- To: Andrew Lunn <andrew dot lunn at ascom dot ch>
- Subject: Re: [ECOS] Ecos-Socket Error
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Thu, 11 Oct 2001 14:36:12 +0100
- Cc: Anagha Anil Bhopale <anagha dot bhopale at wipro dot com>,eCos Disuss <ecos-discuss at sourceware dot cygnus dot com>
- References: <3BC57058.99A8F16B@wipro.com> <20011011152438.P11461@biferten.ma.tech.ascom.ch>
Andrew Lunn wrote:
>
> On Thu, Oct 11, 2001 at 03:41:36PM +0530, Anagha Anil Bhopale wrote:
> > The error is:
> > Socket error: No error
> > bind error: Can't assign requested address
> >
> > I've have used
> > iSocket_Descriptor=socket(PF_INET,SOCK_STREAM,6)
> > to create the socket.
>
> Why pass 6 as the protocol? My linux man page tcp(7) says the protocol
> should be 0.
0 means "default" so for IP, TCP will be the default for
PF_INIT/SOCK_STREAM. More precisely it is 6 though, as per /etc/protocols.
The ip(7) man page sez:
"The only valid values for protocol are 0 and IPPROTO_TCP for TCP sockets
and 0 and IPPROTO_UDP for UDP sockets." IPPROTO_TCP is indeed 6.
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine