From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12264 invoked by alias); 3 May 2004 11:44:49 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 12247 invoked from network); 3 May 2004 11:44:47 -0000 Received: from unknown (HELO cygbert.vinschen.de) (80.132.110.246) by sources.redhat.com with SMTP; 3 May 2004 11:44:47 -0000 Received: by cygbert.vinschen.de (Postfix, from userid 500) id EF8F05811E; Mon, 3 May 2004 13:44:46 +0200 (CEST) Date: Mon, 03 May 2004 11:44:00 -0000 From: Corinna Vinschen To: "cygwin@cygwin.com" Subject: Re: shutdown( socket, SHUT_WR ) - unexpected behaviour Message-ID: <20040503114446.GE2201@cygbert.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: "cygwin@cygwin.com" References: <40941F92.1DDD3E67@hot.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40941F92.1DDD3E67@hot.pl> User-Agent: Mutt/1.4.2i X-SW-Source: 2004-05/txt/msg00042.txt.bz2 On May 2 00:07, Jacek Trzmiel wrote: > > Hi, > > $ cygcheck -cd cygwin > Cygwin Package Information > Package Version > cygwin 1.5.9-1 > > I found some unexpected behaviour of shutdown call. Here is example > program to reproduce problem. It is supposed to send simple http > request to example.org, close writing part of socket, and then wait for > and print reply: > > --- ShutdownTest.cpp ------------------------------------------------ > [...] > --- ShutdownTest.cpp ------------------------------------------------ > > If you compile and run it this way: > $ g++ ShutdownTest.cpp -o ShutdownTest && ./ShutdownTest.exe > > it doesn't print anything. Commenting out shutdown call or adding some > wait before it does make program work as expected: > > $ g++ ShutdownTest.cpp -o ShutdownTest && ./ShutdownTest.exe > HTTP/1.1 200 OK > Date: Sat, 01 May 2004 23:28:20 GMT > Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) > Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT > [...] I've tried your application and I'm not able to reproduce your problem. The shutdown call does not influence sending the buffered data apparently. I've tested with Cygwin 1.5.9 and with a recent snapshot on XP SP1. What's your system? > 1. I suppose that shutdown(sd,SHUT_WR) does not force unflushed buffers > out (i.e. discards them). Am I right? It doesn't flush, but it also doesn't stop the data already buffered from being sent. It's only purpose is to disallow further send calls on the socket. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Co-Project Leader mailto:cygwin@cygwin.com Red Hat, Inc. -- 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/