Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 25 Mar 2005 08:40:28 +0100 From: Joris van der Sande Subject: Re: recv and errno during a connection reset/closed by peer In-reply-to: To: cygwin AT cygwin DOT com Message-id: <4243C06C.3070409@pulserate.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) References: Peter, This works for me: /* Detect dead connections */ int keepalive = 1 ; r = setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (char *)&keepalive, sizeof(keepalive)) ; recv() will now return ECONNABORTED when the host disconnects. Best regards, Joris -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/