Version française
Home     About     Download     Resources     Contact us    
Browse thread
behaviour of Unix.shutdown_connection
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: [Caml-list] Re: behaviour of Unix.shutdown_connection
> If I open a connection with Unix.open_connection, and shut it down
> with Unix.shutdown_connection, do I still need to call close_in and
> close_out on the two channels ? 

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.

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