delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/05/03/07:45:22

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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: Mon, 3 May 2004 13:44:46 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Re: shutdown( socket, SHUT_WR ) - unexpected behaviour
Message-ID: <20040503114446.GE2201@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
References: <40941F92 DOT 1DDD3E67 AT hot DOT pl>
Mime-Version: 1.0
In-Reply-To: <40941F92.1DDD3E67@hot.pl>
User-Agent: Mutt/1.4.2i

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 AT cygwin DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019