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
  • Method Details

    • fromPacket

      public static byte[] fromPacket(ByteBuffer packet)
    • 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

      public static String packetTypeAsString(ByteBuffer packet)
    • packetType

      public static byte packetType(ByteBuffer packet)
    • negotiate

      public static boolean negotiate(org.eclipse.jetty.quic.quiche.QuicheConnection.TokenMinter tokenMinter, ByteBuffer packetRead, ByteBuffer packetToSend) throws IOException
      Fully consumes the packetRead buffer.
      Returns:
      true if a negotiation packet was written to the packetToSend buffer, false if negotiation failed and the packetRead buffer 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 the packetRead buffer if the connection was accepted.
      Returns:
      an established connection if accept succeeded, null if accept failed and negotiation should be tried.
      Throws:
      IOException
    • enableQlog

      public void enableQlog(String filename, String title, String desc) throws IOException
      Throws:
      IOException
    • iterableStreamIds

      protected List<Long> iterableStreamIds(boolean write)
      Specified by:
      iterableStreamIds in class org.eclipse.jetty.quic.quiche.QuicheConnection
    • feedCipherBytes

      public int feedCipherBytes(ByteBuffer buffer, SocketAddress local, SocketAddress peer) throws IOException
      Specified by:
      feedCipherBytes in class org.eclipse.jetty.quic.quiche.QuicheConnection
      Throws:
      IOException
    • drainCipherBytes

      public int drainCipherBytes(ByteBuffer buffer) throws IOException
      Fill the given buffer with cipher text to be sent.
      Specified by:
      drainCipherBytes in class org.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:
      isConnectionClosed in class org.eclipse.jetty.quic.quiche.QuicheConnection
    • isConnectionEstablished

      public boolean isConnectionEstablished()
      Specified by:
      isConnectionEstablished in class org.eclipse.jetty.quic.quiche.QuicheConnection
    • isConnectionInEarlyData

      public boolean isConnectionInEarlyData()
    • nextTimeout

      public long nextTimeout()
      Specified by:
      nextTimeout in class org.eclipse.jetty.quic.quiche.QuicheConnection
    • onTimeout

      public void onTimeout()
      Specified by:
      onTimeout in class org.eclipse.jetty.quic.quiche.QuicheConnection
    • getNegotiatedProtocol

      public String getNegotiatedProtocol()
      Specified by:
      getNegotiatedProtocol in class org.eclipse.jetty.quic.quiche.QuicheConnection
    • close

      public boolean close(long error, String reason)
      Specified by:
      close in class org.eclipse.jetty.quic.quiche.QuicheConnection
    • dispose

      public void dispose()
      Specified by:
      dispose in class org.eclipse.jetty.quic.quiche.QuicheConnection
    • isDraining

      public boolean isDraining()
      Specified by:
      isDraining in class org.eclipse.jetty.quic.quiche.QuicheConnection
    • maxLocalStreams

      public int maxLocalStreams()
      Specified by:
      maxLocalStreams in class org.eclipse.jetty.quic.quiche.QuicheConnection
    • windowCapacity

      public long windowCapacity()
      Specified by:
      windowCapacity in class org.eclipse.jetty.quic.quiche.QuicheConnection
    • windowCapacity

      public long windowCapacity(long streamId) throws IOException
      Specified by:
      windowCapacity in class org.eclipse.jetty.quic.quiche.QuicheConnection
      Throws:
      IOException
    • shutdownStream

      public void shutdownStream(long streamId, boolean writeSide, long error) throws IOException
      Specified by:
      shutdownStream in class org.eclipse.jetty.quic.quiche.QuicheConnection
      Throws:
      IOException
    • feedClearBytesForStream

      public int feedClearBytesForStream(long streamId, ByteBuffer buffer, boolean last) throws IOException
      Specified by:
      feedClearBytesForStream in class org.eclipse.jetty.quic.quiche.QuicheConnection
      Throws:
      IOException
    • drainClearBytesForStream

      public int drainClearBytesForStream(long streamId, ByteBuffer buffer) throws IOException
      Specified by:
      drainClearBytesForStream in class org.eclipse.jetty.quic.quiche.QuicheConnection
      Throws:
      IOException
    • isStreamFinished

      public boolean isStreamFinished(long streamId)
      Specified by:
      isStreamFinished in class org.eclipse.jetty.quic.quiche.QuicheConnection
    • getRemoteCloseInfo

      public org.eclipse.jetty.quic.quiche.QuicheConnection.CloseInfo getRemoteCloseInfo()
      Specified by:
      getRemoteCloseInfo in class org.eclipse.jetty.quic.quiche.QuicheConnection