Dear Andreas,

> I've seen your recent changes to socket_shutdown.
> Maybe you could go one step further and support
> a common use case (SHUT_WR) directly?
> 
> Attached to this email you can find a little
> client/server example application:
> 1) client writes characters, server reads them
> 2) client shuts down connection for writing
> 3) server reads eof-object,
>    writes response (here: received byte count),
>    performs socket shutdown and close
> 4) client reads response until eof-object,
>    prints response and closes socket
> 
> The attached ./make-and-test.bash should print:
> Response string = '11'
> (This is the byte count of "hello world".)
> 
> From my exposure to other languages (mozart/oz),
> shutdown and close are two separate issues, and
> can be implemented independently of each other.
> While low-level close() for all practical purposes
> implies a shutdown, the partial shutdown() for one 
> direction does have its use.
> 
> In essence, I guess that the close_socket arg
> can be removed from socket_shutdown entirely;
> at least it is unclear to me why the call to
> shutdown() depends on it.
> 
> Maybe you can think of a better way to expose the
> three shutdown variants (SHUT_RD, SHUT_WR, SHUT_RDWR)?
I think you are right. Your modifications make a lot of sense. I will
apply this patch with probably a minor modification: from the Scheme
world it would probably be better to use symbols for expressing the
SHUT_XXX constants than using integers or multiple functions.

Thanks a lot for your help.

-- 
Manuel

Reply via email to