On Tue, 5 May 2026 16:46:39 GMT, Alan Bateman <[email protected]> wrote:

>> The initial change in this PR was a one sentence description of this method:
>> 
>>>
>>> {@linkplain #close() Closing} a socket doesn't clear its read-half shutdown 
>>> state,
>>> which means this method will return {@code true}
>>> for a closed socket if {@linkplain  #shutdownInput() shutdownInput()}
>>> completed successfully prior to the socket being closed.
>> 
>> We decided to make it a bit more verbose to clarify what it really means 
>> https://github.com/openjdk/jdk/pull/31000#discussion_r3168263753. I would 
>> need some help with the specific text if this needs to be trimmed down. 
>> Would you have something that we could use here?
>
> We came up with wording for SocketChannel.shutdownInput and maybe the first 
> sentence from that method could be copied over to Socket.shutdownInput 
> (replacing "channel" with "socket" of course). We can also expand the 
> `@throws` description to specify that it throws if the Socket is shutdown for 
> reading.
> 
> If we improved shutdownInput then it would allow the description of 
> isShutdownInput to be re-specified to say that it returns true if the Socket 
> was shutdown for reading with the shutdownInput method. 
> 
> Invoking isInputXXX methods on a closed Socket is a bit of a corner case and 
> we should be able to specify it in a single sentence, like we do already with 
> the isConnected method, e.g. "this method will return true for a closed 
> socket if it was shutdown for reading prior to being closed".

The important word in the new description is **only**. 

I would be happy with:


This method returns {@code true} only if a prior call to {@link 
#shutdownInput()} completed successfully.


Because as a naive user I would expect it to return true after `close()` has 
been called.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/31000#discussion_r3190237022

Reply via email to