From owner-freebsd-stable Tue Dec 5 13: 8:26 2000 From owner-freebsd-stable@FreeBSD.ORG Tue Dec 5 13:08:23 2000 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from merlin.tacni.net (unknown [216.178.136.166]) by hub.freebsd.org (Postfix) with SMTP id CF56737B400 for ; Tue, 5 Dec 2000 13:08:22 -0800 (PST) Received: (qmail 65647 invoked by alias); 5 Dec 2000 21:08:11 -0000 Received: from unknown (HELO prydn.tacni.net) (207.55.167.109) by 216.178.136.168 with SMTP; 5 Dec 2000 21:08:11 -0000 Received: (qmail 75526 invoked by uid 1001); 5 Dec 2000 21:07:58 -0000 Date: Tue, 5 Dec 2000 15:07:58 -0600 From: Erich Zigler To: freebsd-stable@freebsd.org Subject: [keith@digix.dyndns.org: [JDEV] FreeBSD woes -OR- FreeBSD accept() issue] Message-ID: <20001205150758.A75489@superhero.org> Mail-Followup-To: Erich Zigler , freebsd-stable@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Eric-Conspiracy: There is no conspiracy. X-Shane: Hi Shane! Sender: needo@prydn.tacni.net Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG ----- Forwarded message from Keith Minkler ----- > Delivered-To: superhero.org-needo@superhero.org > Date: Tue, 5 Dec 2000 15:55:28 -0500 > From: Keith Minkler > 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 > 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... > > 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