RFR: 8278270: ServerSocket is not thread safe

Alan Bateman alanb at openjdk.java.net
Mon Dec 6 14:05:23 UTC 2021


On Mon, 6 Dec 2021 13:39:11 GMT, Florian Weimer <fweimer at openjdk.org> wrote:

> To what extent is `ServerSocket` required to be thread-safe? I don't think it's part of the specification.

A ServerSocket is required by the spec to be asynchronously closable, that is the motivation for the changes here.

java.net.Socket is similar. In that case, an async close is required to wakeup threads that are blocked on the input stream or output stream. There are several issues there, something for another (related) PR.

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

PR: https://git.openjdk.java.net/jdk/pull/6712


More information about the net-dev mailing list