public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Re: shutdown( socket, SHUT_WR ) - unexpected behaviour
Date: Mon, 03 May 2004 11:44:00 -0000	[thread overview]
Message-ID: <20040503114446.GE2201@cygbert.vinschen.de> (raw)
In-Reply-To: <40941F92.1DDD3E67@hot.pl>

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/

  reply	other threads:[~2004-05-03 11:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-01 22:07 Jacek Trzmiel
2004-05-03 11:44 ` Corinna Vinschen [this message]
2004-05-04  2:19   ` Jacek Trzmiel
2004-05-04  2:55     ` Larry Hall
2004-05-04  9:27       ` Dave Korn
2004-05-04 10:00         ` Keith Moore
2004-05-05  0:40           ` Jacek Trzmiel
2004-05-05  2:05           ` shutdown( socket, SHUT_WR ) - unexpected behaviour - RESOLVED Jacek Trzmiel
2004-05-05  0:35         ` shutdown( socket, SHUT_WR ) - unexpected behaviour Jacek Trzmiel
2004-05-04 12:37     ` Hannu E K Nevalainen
2004-05-05  0:42       ` Jacek Trzmiel
2004-05-04  6:37 Arash Partow
2004-05-04  9:21 ` Dave Korn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040503114446.GE2201@cygbert.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).