Date: Tue, 5 Dec 2000 15:07:58 -0600 From: Erich Zigler <erichz@superhero.org> To: freebsd-stable@freebsd.org Subject: [keith@digix.dyndns.org: [JDEV] FreeBSD woes -OR- FreeBSD accept() issue] Message-ID: <20001205150758.A75489@superhero.org>
next in thread | raw e-mail | index | archive | help
----- Forwarded message from Keith Minkler <keith@digix.dyndns.org> -----
> Delivered-To: superhero.org-needo@superhero.org
> Date: Tue, 5 Dec 2000 15:55:28 -0500
> From: Keith Minkler <keith@digix.dyndns.org>
> To: jdev@jabber.org
> User-Agent: Mutt/1.0.1i
> Subject: [JDEV] FreeBSD woes -OR- FreeBSD accept() issue
> Reply-To: jdev@jabber.org
> Errors-To: jdev-admin@jabber.org
> X-Mailman-Version: 1.0
> List-Id: Jabber Development List <jdev.jabber.org>
> X-BeenThere: jdev@jabber.org
>
> Hey jdev,
>
> I've run into a problem with the 1.2/1.3+ server on FreeBSD, in io_select(1.2) and MIO(1.3)
>
> it seems that the accept() call is blocking, even though the listening socket is set to non-blocking...
>
> here is my code to set the sockets into non-blocking.. this is called for every socket that is put into MIO...
> <from mio.c>
> 599 /* set the socket to non-blocking */
> 600 flags = fcntl(fd, F_GETFL, 0);
> 601 flags |= O_NONBLOCK;
> 602 fcntl(fd, F_SETFL, flags);
>
> ...
> and here is the code that is calling accept()...
> 259 mio _mio_accept(mio m)
> 260 {
> 261 struct sockaddr_in sa;
> 262 size_t sa_size = sizeof(sa);
> 263 int fd;
> 264 mio new;
> 265
> 266 /* pull a socket off the accept queue */
> 267 fd = accept(m->fd, (struct sockaddr*)&sa, (int*)&sa_size);
> 268 if(fd <= 0)
> 269 {
> 270 /* this will try again eventually,
> 271 * if it's a blocking issue */
> 272 return NULL;
> 273 }
>
> these code snippets were taken from the 1.3 server (HEAD CVS) but is similar in the 1.2 server, and neither work correctly on FreeBSD.. is there something here that I am doing wrong that is obvious (or not)?
>
> if anyone could help out, i would very much appreciate it (along with our FreeBSD friends)
>
> Thanks!
>
> Keith Minkler
>
> _______________________________________________
> jdev mailing list
> jdev@jabber.org
> http://mailman.jabber.org/listinfo/jdev
----- End forwarded message -----
This came through the jdev mailing list. They are using my FreeBSD servers
for testing currently, but to no avail. I was wondering if anyone could
offer any insight. We are testing this on a FreeBSD 3.4 server and a FreeBSD
4.1.1 server. Any thoughts?
--
Erich Zigler
Remember: every member of your 'target audience' also owns a broadcasting
station. These 'targets' can shoot back.
-- Michael Rathbun to advertisers, in nanae
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001205150758.A75489>
