Return-Path: From: Marcel Holtmann To: BlueZ development In-Reply-To: References: <450603BA.3090302@vasmac.com> <1158050613.14015.1.camel@localhost> <45081402.8020909@vasmac.com> <1158313791.5233.9.camel@localhost> Date: Wed, 20 Sep 2006 17:05:15 +0200 Message-Id: <1158764715.10356.0.camel@localhost> Mime-Version: 1.0 Subject: Re: [Bluez-devel] socket connect returns EAGAIN Reply-To: BlueZ development List-Id: BlueZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Sender: bluez-devel-bounces@lists.sourceforge.net Errors-To: bluez-devel-bounces@lists.sourceforge.net Hi Ulisses, > > > > > I think the problem is in bt_sock_wait_state(...). This always returns > > > > > -EAGAIN if timeout is zero (which it is if the socket is set non > > > > > blocking). But may be I'm missing something. > > > > > > > > I've come to a similar conclusion. I'm not sure why it's returning -EAGAIN. > > > > However, looking at the x25 transport (af_x25.c), it takes a different > > > > approach; > > > > if O_NONBLOCK is set they don't call the blocking routine at all. Maybe a > > > > similar approach should be taken here. > > > > > > > returning EAGAIN is fine for a listening socket. I first thought the > > > solution of not calling bt_sock_wait_state() for a non blocking connect > > > would be the easiest solution, too. But then you have to correct it on > > > several places. Just changing bt_sock_wait_state() will solve it for > > > various socket types. > > > > sounds like a good idea. Anyone preparing a patch for it? > > Sorry, but I'm failing to see why we can't just do a > s/EAGAIN/EINPROGRESS/ inside bt_sock_wait_state(). Does anyone mind to > explain, please? what about the server socket. In this case EAGAIN is fine. Regards Marcel ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel