Package com.ngrok
Interface Listener<C extends Connection>
-
- Type Parameters:
C
- the type ofConnection
s 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 aListener
for processing the implementation specific logic.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Listener.Builder<L extends Listener>
Represents a builder that can create newListener
instances.static interface
Listener.Edge
Represents an edgeListener
.static interface
Listener.Endpoint
Represents an endpointListener
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description C
accept()
Waits for the next connection and returns it.void
close()
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 IOException
Closes thisListener
.- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
- if an I/O error occurs
-
-