Package io.undertow.server.protocol
Class ParseTimeoutUpdater
java.lang.Object
io.undertow.server.protocol.ParseTimeoutUpdater
- All Implemented Interfaces:
ServerConnection.CloseListener
,Closeable
,AutoCloseable
,Runnable
public final class ParseTimeoutUpdater
extends Object
implements Runnable, ServerConnection.CloseListener, Closeable
Wrapper for parse timeout.
- Author:
- Sebastian Laskawiec
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionParseTimeoutUpdater
(org.xnio.channels.ConnectedChannel channel, long requestParseTimeout, long requestIdleTimeout) Creates new instance of ParseTimeoutSourceConduit.ParseTimeoutUpdater
(org.xnio.channels.ConnectedChannel channel, long requestParseTimeout, long requestIdleTimeout, Runnable closeTask) Creates new instance of ParseTimeoutSourceConduit. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
closed
(ServerConnection connection) void
Called when the connection goes idlevoid
Called when a request is received, however it is not parsed in a single read() call.void
Cancels timeout countdown.void
run()
-
Constructor Details
-
ParseTimeoutUpdater
public ParseTimeoutUpdater(org.xnio.channels.ConnectedChannel channel, long requestParseTimeout, long requestIdleTimeout) Creates new instance of ParseTimeoutSourceConduit.- Parameters:
channel
- Channel which will be closed in case of timeout.requestParseTimeout
- Timeout value. Negative value will indicate that this updated is disabled.requestIdleTimeout
-
-
ParseTimeoutUpdater
public ParseTimeoutUpdater(org.xnio.channels.ConnectedChannel channel, long requestParseTimeout, long requestIdleTimeout, Runnable closeTask) Creates new instance of ParseTimeoutSourceConduit.- Parameters:
channel
- Channel which will be closed in case of timeout.requestParseTimeout
- Timeout value. Negative value will indicate that this updated is disabled.requestIdleTimeout
-
-
-
Method Details
-
connectionIdle
public void connectionIdle()Called when the connection goes idle -
failedParse
public void failedParse()Called when a request is received, however it is not parsed in a single read() call. This starts a timer, and if the request is not parsed within this time then the connection is closed. -
requestStarted
public void requestStarted()Cancels timeout countdown.Should be called after parsing is complete (to avoid closing connection during other activities).
-
run
public void run() -
closed
- Specified by:
closed
in interfaceServerConnection.CloseListener
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-