Package com.ngrok
Interface Listener<C extends Connection>
-
- Type Parameters:
C- the type ofConnections this listener accepts
- All Superinterfaces:
AutoCloseable,ListenerInfo
- All Known Subinterfaces:
Listener.Edge,Listener.Endpoint
public interface Listener<C extends Connection> extends ListenerInfo, AutoCloseable
Listener enables applications to handle incoming traffic proxied by ngrok. Each connection to ngrok is forwarded to an instance of aListenerfor processing the implementation specific logic.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceListener.Builder<L extends Listener>Represents a builder that can create newListenerinstances.static interfaceListener.EdgeRepresents an edgeListener.static interfaceListener.EndpointRepresents an endpointListener.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Caccept()Waits for the next connection and returns it.voidclose()Closes thisListener.-
Methods inherited from interface com.ngrok.ListenerInfo
getForwardsTo, getId, getMetadata
-
-
-
-
Method Detail
-
accept
C accept() throws IOException
Waits for the next connection and returns it.- Returns:
- the connection
- Throws:
IOException- if an I/O error occurs
-
close
void close() throws IOExceptionCloses thisListener.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException- if an I/O error occurs
-
-