Class NgrokEndpoint

  • All Implemented Interfaces:
    Closeable, AutoCloseable, org.eclipse.jetty.io.EndPoint

    public class NgrokEndpoint
    extends org.eclipse.jetty.io.AbstractEndPoint
    A class representing an endpoint for ngrok connection.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.eclipse.jetty.io.EndPoint

        org.eclipse.jetty.io.EndPoint.Wrapper
    • Constructor Summary

      Constructors 
      Constructor Description
      NgrokEndpoint​(org.eclipse.jetty.util.thread.Scheduler scheduler, Connection conn)
      Constructs a new ngrok endpoint with the specified scheduler and connection.
    • Constructor Detail

      • NgrokEndpoint

        public NgrokEndpoint​(org.eclipse.jetty.util.thread.Scheduler scheduler,
                             Connection conn)
        Constructs a new ngrok endpoint with the specified scheduler and connection.
        Parameters:
        scheduler - the scheduler to use for the endpoint
        conn - the connection to use for the endpoint
    • Method Detail

      • onIncompleteFlush

        protected void onIncompleteFlush()
        Throws an UnsupportedOperationException, as incomplete flush is not supported by ngrok endpoints.
        Specified by:
        onIncompleteFlush in class org.eclipse.jetty.io.AbstractEndPoint
        Throws:
        UnsupportedOperationException - if the method is called
      • needsFillInterest

        protected void needsFillInterest()
                                  throws IOException
        Schedules the endpoint to be filled with interest.
        Specified by:
        needsFillInterest in class org.eclipse.jetty.io.AbstractEndPoint
        Throws:
        IOException - if an I/O error occurs
      • fill

        public int fill​(ByteBuffer buffer)
                 throws IOException
        Fills the endpoint with data from the connection.
        Parameters:
        buffer - the buffer to fill with data
        Returns:
        the number of bytes read from the connection
        Throws:
        IOException - if an I/O error occurs
      • flush

        public boolean flush​(ByteBuffer... buffer)
                      throws IOException
        Flushes the endpoint with data from the connection.
        Parameters:
        buffer - the buffer to flush with data
        Returns:
        true if the buffer was completely flushed, false otherwise
        Throws:
        IOException - if an I/O error occurs
      • getLocalSocketAddress

        public SocketAddress getLocalSocketAddress()
        Specified by:
        getLocalSocketAddress in interface org.eclipse.jetty.io.EndPoint
        Overrides:
        getLocalSocketAddress in class org.eclipse.jetty.io.AbstractEndPoint
      • getRemoteSocketAddress

        public SocketAddress getRemoteSocketAddress()
        Specified by:
        getRemoteSocketAddress in interface org.eclipse.jetty.io.EndPoint
        Overrides:
        getRemoteSocketAddress in class org.eclipse.jetty.io.AbstractEndPoint