Class JnaQuicheConnection
java.lang.Object
org.eclipse.jetty.quic.quiche.Quiche
org.eclipse.jetty.quic.quiche.jna.JnaQuicheConnection
- 
Nested Class Summary
Nested classes/interfaces inherited from class Quiche
Quiche.CloseInfo, Quiche.TokenMinter, Quiche.TokenValidationException, Quiche.TokenValidator - 
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic JnaQuicheConnectionconnect(QuicheConfig quicheConfig, InetSocketAddress local, InetSocketAddress peer) static JnaQuicheConnectionconnect(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, boolean[] last) voidenableQlog(String filename, String title, String desc) intfeedCipherBytes(ByteBuffer buffer, SocketAddress local, SocketAddress peer) Read the buffer of cipher text coming from the network.intfeedClearBytesForStream(long streamId, ByteBuffer buffer, boolean last) static byte[]fromPacket(ByteBuffer packet) byte[]booleanbooleanbooleanbooleanbooleanisStreamFinished(long streamId) iterableStreamIds(boolean write) intstatic booleannegotiate(Quiche.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(QuicheConfig quicheConfig, Quiche.TokenValidator tokenValidator, ByteBuffer packetRead, SocketAddress local, SocketAddress peer) Fully consumes thepacketReadbuffer if the connection was accepted.longlongwindowCapacity(long streamId) Methods inherited from class Quiche
feedClearBytesForStream, feedFinForStream, probeConnectionId, readableStreamIds, toInetSocketAddress, writableStreamIds 
- 
Method Details
- 
fromPacket
 - 
connect
public static JnaQuicheConnection connect(QuicheConfig quicheConfig, InetSocketAddress local, InetSocketAddress peer) throws IOException - Throws:
 IOException
 - 
connect
public static JnaQuicheConnection connect(QuicheConfig quicheConfig, InetSocketAddress local, InetSocketAddress peer, int connectionIdLength) throws IOException - Throws:
 IOException
 - 
packetTypeAsString
 - 
packetType
 - 
negotiate
public static boolean negotiate(Quiche.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(QuicheConfig quicheConfig, Quiche.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
 - 
getPeerCertificate
public byte[] getPeerCertificate()- Specified by:
 getPeerCertificatein classQuiche
 - 
iterableStreamIds
- Specified by:
 iterableStreamIdsin classQuiche
 - 
feedCipherBytes
public int feedCipherBytes(ByteBuffer buffer, SocketAddress local, SocketAddress peer) throws IOException Description copied from class:QuicheRead the buffer of cipher text coming from the network.- Specified by:
 feedCipherBytesin classQuiche- Parameters:
 buffer- the buffer to read.local- the local address on which the buffer was received.peer- the address of the peer from which the buffer was received.- Returns:
 - how many bytes were consumed.
 - Throws:
 IOException
 - 
drainCipherBytes
Fill the given buffer with cipher text to be sent.- Specified by:
 drainCipherBytesin classQuiche- Parameters:
 buffer- the buffer to fill.- Returns:
 - how many bytes were added to the buffer.
 - Throws:
 IOException
 - 
isConnectionClosed
public boolean isConnectionClosed()- Specified by:
 isConnectionClosedin classQuiche
 - 
isConnectionEstablished
public boolean isConnectionEstablished()- Specified by:
 isConnectionEstablishedin classQuiche
 - 
isConnectionInEarlyData
public boolean isConnectionInEarlyData() - 
nextTimeout
public long nextTimeout()- Specified by:
 nextTimeoutin classQuiche
 - 
onTimeout
 - 
getNegotiatedProtocol
- Specified by:
 getNegotiatedProtocolin classQuiche
 - 
close
 - 
dispose
 - 
isDraining
public boolean isDraining()- Specified by:
 isDrainingin classQuiche
 - 
maxLocalStreams
public int maxLocalStreams()- Specified by:
 maxLocalStreamsin classQuiche
 - 
windowCapacity
public long windowCapacity()- Specified by:
 windowCapacityin classQuiche
 - 
windowCapacity
- Specified by:
 windowCapacityin classQuiche- Throws:
 IOException
 - 
shutdownStream
- Specified by:
 shutdownStreamin classQuiche- Throws:
 IOException
 - 
feedClearBytesForStream
public int feedClearBytesForStream(long streamId, ByteBuffer buffer, boolean last) throws IOException - Specified by:
 feedClearBytesForStreamin classQuiche- Throws:
 IOException
 - 
drainClearBytesForStream
public int drainClearBytesForStream(long streamId, ByteBuffer buffer, boolean[] last) throws IOException - Specified by:
 drainClearBytesForStreamin classQuiche- Throws:
 IOException
 - 
isStreamFinished
public boolean isStreamFinished(long streamId) - Specified by:
 isStreamFinishedin classQuiche- Parameters:
 streamId- the stream id- Returns:
 - whether all the data has been read from the specified stream.
 
 - 
getRemoteCloseInfo
- Specified by:
 getRemoteCloseInfoin classQuiche
 - 
getLocalCloseInfo
- Specified by:
 getLocalCloseInfoin classQuiche
 
 -