Package com.ngrok.jetty
Class NgrokEndpoint
- java.lang.Object
-
- org.eclipse.jetty.io.IdleTimeout
-
- org.eclipse.jetty.io.AbstractEndPoint
-
- com.ngrok.jetty.NgrokEndpoint
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.eclipse.jetty.io.EndPoint
public class NgrokEndpoint extends org.eclipse.jetty.io.AbstractEndPointA class representing an endpoint for ngrok connection.
-
-
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intfill(ByteBuffer buffer)Fills the endpoint with data from the connection.booleanflush(ByteBuffer... buffer)Flushes the endpoint with data from the connection.SocketAddressgetLocalSocketAddress()SocketAddressgetRemoteSocketAddress()ObjectgetTransport()Throws anUnsupportedOperationException, as the transport used by ngrok endpoints is not supported.protected voidneedsFillInterest()Schedules the endpoint to be filled with interest.protected voidonIncompleteFlush()Throws anUnsupportedOperationException, as incomplete flush is not supported by ngrok endpoints.-
Methods inherited from class org.eclipse.jetty.io.AbstractEndPoint
close, close, doClose, doShutdownInput, doShutdownOutput, fillInterested, getConnection, getCreatedTimeStamp, getFillInterest, getLocalAddress, getRemoteAddress, getWriteFlusher, isFillInterested, isInputShutdown, isOpen, isOutputShutdown, onClose, onClose, onIdleExpired, onOpen, reset, setConnection, shutdownInput, shutdownOutput, toConnectionString, toEndPointString, toString, tryFillInterested, upgrade, write
-
Methods inherited from class org.eclipse.jetty.io.IdleTimeout
checkIdleTimeout, getIdleFor, getIdleTimeout, getScheduler, notIdle, setIdleTimeout
-
-
-
-
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 endpointconn- the connection to use for the endpoint
-
-
Method Detail
-
onIncompleteFlush
protected void onIncompleteFlush()
Throws anUnsupportedOperationException, as incomplete flush is not supported by ngrok endpoints.- Specified by:
onIncompleteFlushin classorg.eclipse.jetty.io.AbstractEndPoint- Throws:
UnsupportedOperationException- if the method is called
-
needsFillInterest
protected void needsFillInterest() throws IOExceptionSchedules the endpoint to be filled with interest.- Specified by:
needsFillInterestin classorg.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
-
getTransport
public Object getTransport()
Throws anUnsupportedOperationException, as the transport used by ngrok endpoints is not supported.- Throws:
UnsupportedOperationException- if the method is called
-
getLocalSocketAddress
public SocketAddress getLocalSocketAddress()
- Specified by:
getLocalSocketAddressin interfaceorg.eclipse.jetty.io.EndPoint- Overrides:
getLocalSocketAddressin classorg.eclipse.jetty.io.AbstractEndPoint
-
getRemoteSocketAddress
public SocketAddress getRemoteSocketAddress()
- Specified by:
getRemoteSocketAddressin interfaceorg.eclipse.jetty.io.EndPoint- Overrides:
getRemoteSocketAddressin classorg.eclipse.jetty.io.AbstractEndPoint
-
-