Class JnaQuicheConnection
java.lang.Object
org.eclipse.jetty.quic.quiche.QuicheConnection
org.eclipse.jetty.quic.quiche.jna.JnaQuicheConnection
public class JnaQuicheConnection
extends org.eclipse.jetty.quic.quiche.QuicheConnection
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.quic.quiche.QuicheConnection
org.eclipse.jetty.quic.quiche.QuicheConnection.CloseInfo, org.eclipse.jetty.quic.quiche.QuicheConnection.TokenMinter, org.eclipse.jetty.quic.quiche.QuicheConnection.TokenValidationException, org.eclipse.jetty.quic.quiche.QuicheConnection.TokenValidator -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic JnaQuicheConnectionconnect(org.eclipse.jetty.quic.quiche.QuicheConfig quicheConfig, InetSocketAddress local, InetSocketAddress peer) static JnaQuicheConnectionconnect(org.eclipse.jetty.quic.quiche.QuicheConfig quicheConfig, InetSocketAddress local, InetSocketAddress peer, int connectionIdLength) voiddispose()intdrainCipherBytes(ByteBuffer buffer) Fill the given buffer with cipher text to be sent.intdrainClearBytesForStream(long streamId, ByteBuffer buffer) voidenableQlog(String filename, String title, String desc) intfeedCipherBytes(ByteBuffer buffer, SocketAddress local, SocketAddress peer) intfeedClearBytesForStream(long streamId, ByteBuffer buffer, boolean last) static byte[]fromPacket(ByteBuffer packet) org.eclipse.jetty.quic.quiche.QuicheConnection.CloseInfobooleanbooleanbooleanbooleanbooleanisStreamFinished(long streamId) iterableStreamIds(boolean write) intstatic booleannegotiate(org.eclipse.jetty.quic.quiche.QuicheConnection.TokenMinter tokenMinter, ByteBuffer packetRead, ByteBuffer packetToSend) Fully consumes thepacketReadbuffer.longvoidstatic bytepacketType(ByteBuffer packet) static StringpacketTypeAsString(ByteBuffer packet) voidshutdownStream(long streamId, boolean writeSide, long error) static JnaQuicheConnectiontryAccept(org.eclipse.jetty.quic.quiche.QuicheConfig quicheConfig, org.eclipse.jetty.quic.quiche.QuicheConnection.TokenValidator tokenValidator, ByteBuffer packetRead, SocketAddress local, SocketAddress peer) Fully consumes thepacketReadbuffer if the connection was accepted.longlongwindowCapacity(long streamId) Methods inherited from class org.eclipse.jetty.quic.quiche.QuicheConnection
feedClearBytesForStream, feedFinForStream, readableStreamIds, writableStreamIds
-
Method Details
-
fromPacket
-
connect
public static JnaQuicheConnection connect(org.eclipse.jetty.quic.quiche.QuicheConfig quicheConfig, InetSocketAddress local, InetSocketAddress peer) throws IOException - Throws:
IOException
-
connect
public static JnaQuicheConnection connect(org.eclipse.jetty.quic.quiche.QuicheConfig quicheConfig, InetSocketAddress local, InetSocketAddress peer, int connectionIdLength) throws IOException - Throws:
IOException
-
packetTypeAsString
-
packetType
-
negotiate
public static boolean negotiate(org.eclipse.jetty.quic.quiche.QuicheConnection.TokenMinter tokenMinter, ByteBuffer packetRead, ByteBuffer packetToSend) throws IOException Fully consumes thepacketReadbuffer.- Returns:
- true if a negotiation packet was written to the
packetToSendbuffer, false if negotiation failed and thepacketReadbuffer can be dropped. - Throws:
IOException
-
tryAccept
public static JnaQuicheConnection tryAccept(org.eclipse.jetty.quic.quiche.QuicheConfig quicheConfig, org.eclipse.jetty.quic.quiche.QuicheConnection.TokenValidator tokenValidator, ByteBuffer packetRead, SocketAddress local, SocketAddress peer) throws IOException Fully consumes thepacketReadbuffer if the connection was accepted.- Returns:
- an established connection if accept succeeded, null if accept failed and negotiation should be tried.
- Throws:
IOException
-
enableQlog
- Throws:
IOException
-
iterableStreamIds
- Specified by:
iterableStreamIdsin classorg.eclipse.jetty.quic.quiche.QuicheConnection
-
feedCipherBytes
public int feedCipherBytes(ByteBuffer buffer, SocketAddress local, SocketAddress peer) throws IOException - Specified by:
feedCipherBytesin classorg.eclipse.jetty.quic.quiche.QuicheConnection- Throws:
IOException
-
drainCipherBytes
Fill the given buffer with cipher text to be sent.- Specified by:
drainCipherBytesin classorg.eclipse.jetty.quic.quiche.QuicheConnection- Parameters:
buffer- the buffer to fill.- Returns:
- how many bytes were added to the buffer.
- Throws:
IOException
-
isConnectionClosed
public boolean isConnectionClosed()- Specified by:
isConnectionClosedin classorg.eclipse.jetty.quic.quiche.QuicheConnection
-
isConnectionEstablished
public boolean isConnectionEstablished()- Specified by:
isConnectionEstablishedin classorg.eclipse.jetty.quic.quiche.QuicheConnection
-
isConnectionInEarlyData
public boolean isConnectionInEarlyData() -
nextTimeout
public long nextTimeout()- Specified by:
nextTimeoutin classorg.eclipse.jetty.quic.quiche.QuicheConnection
-
onTimeout
public void onTimeout()- Specified by:
onTimeoutin classorg.eclipse.jetty.quic.quiche.QuicheConnection
-
getNegotiatedProtocol
- Specified by:
getNegotiatedProtocolin classorg.eclipse.jetty.quic.quiche.QuicheConnection
-
close
- Specified by:
closein classorg.eclipse.jetty.quic.quiche.QuicheConnection
-
dispose
public void dispose()- Specified by:
disposein classorg.eclipse.jetty.quic.quiche.QuicheConnection
-
isDraining
public boolean isDraining()- Specified by:
isDrainingin classorg.eclipse.jetty.quic.quiche.QuicheConnection
-
maxLocalStreams
public int maxLocalStreams()- Specified by:
maxLocalStreamsin classorg.eclipse.jetty.quic.quiche.QuicheConnection
-
windowCapacity
public long windowCapacity()- Specified by:
windowCapacityin classorg.eclipse.jetty.quic.quiche.QuicheConnection
-
windowCapacity
- Specified by:
windowCapacityin classorg.eclipse.jetty.quic.quiche.QuicheConnection- Throws:
IOException
-
shutdownStream
- Specified by:
shutdownStreamin classorg.eclipse.jetty.quic.quiche.QuicheConnection- Throws:
IOException
-
feedClearBytesForStream
public int feedClearBytesForStream(long streamId, ByteBuffer buffer, boolean last) throws IOException - Specified by:
feedClearBytesForStreamin classorg.eclipse.jetty.quic.quiche.QuicheConnection- Throws:
IOException
-
drainClearBytesForStream
- Specified by:
drainClearBytesForStreamin classorg.eclipse.jetty.quic.quiche.QuicheConnection- Throws:
IOException
-
isStreamFinished
public boolean isStreamFinished(long streamId) - Specified by:
isStreamFinishedin classorg.eclipse.jetty.quic.quiche.QuicheConnection
-
getRemoteCloseInfo
public org.eclipse.jetty.quic.quiche.QuicheConnection.CloseInfo getRemoteCloseInfo()- Specified by:
getRemoteCloseInfoin classorg.eclipse.jetty.quic.quiche.QuicheConnection
-