--- old/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/Transmitter.java 2017-11-30 04:04:48.482379826 -0800 +++ new/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/websocket/Transmitter.java 2017-11-30 04:04:48.289362956 -0800 @@ -40,7 +40,7 @@ * to accept a new message. Until then, the transmitter is considered "busy" and * an IllegalStateException will be thrown on each attempt to invoke send. */ -final class Transmitter { +public class Transmitter { /* This flag is used solely for assertions */ private final AtomicBoolean busy = new AtomicBoolean(); @@ -49,8 +49,8 @@ private final RawChannel channel; private final RawChannel.RawEvent event; - Transmitter(RawChannel channel) { - this.channel = requireNonNull(channel); + public Transmitter(RawChannel channel) { + this.channel = channel; this.event = createHandler(); } @@ -59,7 +59,9 @@ * A {@code StackOverflowError} may thus occur if there's a possibility * that this method is called again by the supplied handler. */ - void send(OutgoingMessage message, Consumer completionHandler) { + public void send(OutgoingMessage message, + Consumer completionHandler) + { requireNonNull(message); requireNonNull(completionHandler); if (!busy.compareAndSet(false, true)) { @@ -68,6 +70,10 @@ send0(message, completionHandler); } + public void close() throws IOException { + channel.shutdownOutput(); + } + private RawChannel.RawEvent createHandler() { return new RawChannel.RawEvent() {