| www.delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| 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 <cone AT pulserate DOT com> |
| Subject: | Re: recv and errno during a connection reset/closed by peer |
| In-reply-to: | <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAUKQItienSEKG+9226yKd5cKAAAAQAAAAABEV8lCYiUqikvlg/nhWLAEAAAAA@sbcglobal.net> |
| To: | cygwin AT cygwin DOT com |
| Message-id: | <4243C06C.3070409@pulserate.com> |
| MIME-version: | 1.0 |
| User-Agent: | Mozilla Thunderbird 1.0 (Windows/20041206) |
| References: | <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAUKQItienSEKG+9226yKd5cKAAAAQAAAAABEV8lCYiUqikvlg/nhWLAEAAAAA AT sbcglobal DOT net> |
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/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |