Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Sep 2005 18:56:16 +0300
From:      victor cruceru <victor.cruceru@gmail.com>
To:        erkan kolemen <erkankolemen@yahoo.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: accept: Invalid argument
Message-ID:  <494025505090608566b1c7bb0@mail.gmail.com>
In-Reply-To: <20050906153451.86233.qmail@web33406.mail.mud.yahoo.com>
References:  <20050906153451.86233.qmail@web33406.mail.mud.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Did you call bind() and especially listen() before accept()?
victor cruceru


On 9/6/05, erkan kolemen <erkankolemen@yahoo.com> wrote:
> Hi,
>=20
> In a daemon loop, i am using accept() to accept
> incoming connections.
>=20
> while(1) {
> if((fd =3D accept(socketd, (struct sockaddr *) &addr,
> &addrlen)) =3D=3D -1) {
>   syslog(LOG_ERR, "accept: %s", strerror(errno));
>   continue;
> }
> else {
>  ...
> }
>=20
> accept always fails. What is wrong? i could create
> socket and i got a positive integer value as socket
> descriptor. following is from syslog:
>=20
> Sep  6 17:20:50 devel pro[99227]: accept: Invalid
> argument
> Sep  6 17:21:20 devel last message repeated 204686
> times
>=20
> What is wrong? i am calling accept before fork().. So
> i don't think child process affecting parent process.
>=20
> thanks and regards...
>=20
> - erkan
>=20
>=20
>=20
>=20
> ______________________________________________________
> Click here to donate to the Hurricane Katrina relief effort.
> http://store.yahoo.com/redcross-donate3/
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org=
"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?494025505090608566b1c7bb0>