APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.internal.net.http

pack-priv final Class SocketTube

extends Object
implements FlowTube
Class Inheritance
All Implemented Interfaces
jdk.internal.net.http.common.FlowTube, java.util.concurrent.Flow.Subscriber, java.util.concurrent.Flow.Publisher
Imports
java.io.IOException, java.nio.ByteBuffer, java.util.List, .Objects, .ArrayList, java.util.concurrent.ConcurrentLinkedQueue, .Flow, java.util.concurrent.atomic.AtomicReference, java.nio.channels.SelectableChannel, .SelectionKey, .SocketChannel, java.util.concurrent.locks.Lock, .ReentrantLock, java.util.function.Consumer, .Supplier, jdk.internal.net.http.common.BufferSupplier, .Demand, .FlowTube, .Log, .Logger, .SequentialScheduler, .SequentialScheduler.DeferredCompleter, .SequentialScheduler.RestartableTask, .Utils

A SocketTube is a terminal tube plugged directly into the socket. The read subscriber should call subscribe on the SocketTube before the SocketTube is subscribed to the write publisher.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
private class
private class
private static class
private abstract static class
SocketTube.SocketFlowEvent

A repeatable event that can be paused or resumed by changing its interestOps.

private static class
SocketTube.SocketFlowTask

A restartable task used to process tasks in sequence.

private static class

Field Summary

Modifier and TypeField and Description
private final SocketChannel
private final HttpClientImpl
private final String
pack-priv final Logger
pack-priv static final List<ByteBuffer>
private final AtomicReference<Throwable>
private final Object
pack-priv static final int
pack-priv static final List<ByteBuffer>
private final SocketTube.InternalReadPublisher
private final SocketTube.SliceBufferSource
private final SocketTube.InternalWriteSubscriber

Constructor Summary

AccessConstructor and Description
public
SocketTube(HttpClientImpl client, SocketChannel channel, Supplier<ByteBuffer> buffersFactory, String connectionLabel)

Method Summary

Modifier and TypeMethod and Description
pack-priv final String
public void
connectFlows(FlowTube.TubePublisher writePublisher, FlowTube.TubeSubscriber readSubscriber)

Overrides default jdk.internal.net.http.common.FlowTube.connectFlows.

Connects the bidirectional flows to a write Publisher and a read Subscriber.

pack-priv final String
pack-priv void
public boolean

Returns:

true if this flow is finished.
isFinished
()

Implements jdk.internal.net.http.common.FlowTube.isFinished.

Returns true if this flow is finished.

private static <T> List<T>
listOf(List<T> list, T item)

public void
onComplete()

Implements java.util.concurrent.Flow.Subscriber.onComplete.

Method invoked when it is known that no additional Subscriber method invocations will occur for a Subscription that is not already terminated by error, after which no other Subscriber methods are invoked by the Subscription.

public void
onError(Throwable throwable)

Implements java.util.concurrent.Flow.Subscriber.onError.

Method invoked upon an unrecoverable error encountered by a Publisher or Subscription, after which no other Subscriber methods are invoked by the Subscription.

public void
onNext(List<ByteBuffer> item)

Implements java.util.concurrent.Flow.Subscriber.onNext.

Method invoked with a Subscription's next item.

public void
onSubscribe(Flow.Subscription subscription)

Implements java.util.concurrent.Flow.Subscriber.onSubscribe.

Method invoked prior to invoking any other Subscriber methods for the given Subscription.

private void
private List<ByteBuffer>
private void
pack-priv void
public void
subscribe(Flow.Subscriber<? super List<ByteBuffer>> s)

Implements java.util.concurrent.Flow.Publisher.subscribe.

Adds the given Subscriber if possible.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

private long
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait