From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10217 invoked by alias); 2 Jan 2008 11:02:13 -0000 Received: (qmail 10109 invoked by uid 22791); 2 Jan 2008 11:02:04 -0000 X-Spam-Check-By: sourceware.org Received: from smtp.silicomp.fr (HELO smtp.silicomp.fr) (194.51.78.40) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 02 Jan 2008 10:57:41 +0000 Received: from [172.16.6.69] ([172.16.6.69]) by smtp.silicomp.fr (8.13.8/8.12.10) with ESMTP id m02AvZA2030234 for ; Wed, 2 Jan 2008 11:57:35 +0100 Message-ID: <477B6E1E.1080206@orange-ftgroup.com> Date: Wed, 02 Jan 2008 11:02:00 -0000 From: NGUYEN Thanh SILICOMP User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: ecos-discuss@ecos.sourceware.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.8 (smtp.silicomp.fr [194.51.78.40]); Wed, 02 Jan 2008 11:57:35 +0100 (CET) X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] Application is blocked on the while loop within bsd_connect() function X-SW-Source: 2008-01/txt/msg00001.txt.bz2 Hi all, Firstly, happy new year & best wished to all. I'm working on an application connecting to FTP server using ecos ftpclient package. I constate that the application waits for ever on a blocking semaphore of cyg_tsleep() function when there is no ftp server available. In fact, for connecting to ftp server, ftpclient uses connect() that calls itself bas_connect() in which the while loop is used for waiting for the connection etablishment or an error occurring : while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) { error = tsleep((caddr_t)&so->so_timeo, PSOCK | PCATCH, netcon, 0); if (error) break; } The paramter timo of tsleep set to 0 makes cyg_tsleep waiting for a blocking semaphore at line 325 of the file synch.c (net/tcpip/current/src/ecos/synch.c). And the wait time is usually long and triggers the watchdog process in my application. I would like to know that there is any way to set up a timeout on socket before calling connect() so that the application will be able to get out this blocking situation ? Any idea or sugestion will be appreciated. Thank in advance for your helps. Thanh NGUYEN -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss