From: kr <russell@ais.alumdev.oberlin.edu>
Subject: bind, socket, EADDRNOTAVAIL
Date: 1999/11/15 [thread overview]
Message-ID: <Pine.OSF.3.96.991115194304.30871B-100000@ais.alumdev.oberlin.edu> (raw)
I've run into an obstacle of sorts trying to port a program to Tru64 /
Digital Unix... where the program uses an internet socket to set up
a listening connection on an unpriveleged port, or where it is supposed
to, the bind operation is failing with errno "EADDRNOTAVAIL".
Any idea as to why? (i.e. does this platform have some socket-related
idiosyncrasies I'm unaware of?) Code fragment follows.
......
in_addr numeric_addr; struct sockaddr_in addr_in;
......
if ((in_port=socket(AF_INET,SOCK_STREAM,0)) < 0) {
perror("socket"); exit(EXIT_FAILURE);
}
numeric_addr.s_addr=htonl(inet_addr("127.0.0.1"));
addr_in.sin_port = 1039; /* for example */
addr_in.sin_family = PF_INET;
addr_in.sin_addr = numeric_addr;
if ( bind(in_port,(struct sockaddr *) & addr_in,sizeof(addr_in)) < 0) {
perror("bind"); exit(EXIT_FAILURE); /* and voila! failure occurs. */
}
......
Very normal, vanilla stuff. ...I've tried running the program on two
different machines, with and without root privelege; I've even tried
varying the ports used, and whether or not the local host's network
address is named explicitly.
So I must be missing something obvious. Or perhaps there is an unknown
(and unwanted) DEC security feature enabled by default on both machines,
which is preventing the socket from binding as expected. Or I am the
unwitting victim of a subtle, *godawful* coding gaffe.
This is more-or-less textbook socket programming. So if you have
an inkling what's going on, give a buzz...
TIA.
Katherine Russell
Programmer/ Analyst, Oberlin College Development Resources
russell@ais.oberlin.edu
. ignore, override, become
next reply other threads:[~1999-11-15 5:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-11-15 5:00 kr [this message]
1999-11-15 5:00 ` bind, socket, EADDRNOTAVAIL kr
1999-11-18 5:00 ` Gerard Gobillard
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox