caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien Doligez <Damien.Doligez@inria.fr>
To: caml-list@inria.fr
Subject: Re:  [Caml-list] Re: behaviour of Unix.shutdown_connection
Date: Thu, 15 Feb 2001 15:20:41 +0100 (MET)	[thread overview]
Message-ID: <200102151420.PAA0000032585@beaune.inria.fr> (raw)

>From: Xavier Leroy <Xavier.Leroy@inria.fr>

>Yes.  Basically, shutdown_connection just sends an "end of file"
>condition to the program connected to the socket on the other side.
>The other program can then finish sending what it has to send, then close
>its side of the socket.  On receiving an "end of file" on your side,
>your program knows that the data exchange is over and can (and must)
>then close the descriptors on its side.

There is only one descriptor, and it is shared between the two
channels.  Thus if you close both channels, then the descriptor gets
closed twice.  If it was reopened in-between (for example in a
multithreaded program), then some unrelated part of your program will
have its descriptor closed under its feet.

So you must close the out_channel that was returned by
Unix.open_connection, but not the in_channel; and this is true whether
you called Unix.shutdown_connection or not.


Warning: I have not tested it.

-- Damien
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


             reply	other threads:[~2001-02-15 14:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-15 14:20 Damien Doligez [this message]
2001-02-15 14:35 ` Daniel de Rauglaudre
  -- strict thread matches above, loose matches on Subject: below --
2001-02-12 13:52 Alan Schmitt
2001-02-15 10:43 ` [Caml-list] " Xavier Leroy

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=200102151420.PAA0000032585@beaune.inria.fr \
    --to=damien.doligez@inria.fr \
    --cc=caml-list@inria.fr \
    /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 NNTP newsgroup(s).