org.webpieces.frontend2.impl.TimeoutHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http-frontend2 Show documentation
Show all versions of http-frontend2 Show documentation
Create a webserver with this library in just 3 lines of code. just register your HttpRequestListener and it feeds you a FrontendSocket that you write HttpResponses to
package org.webpieces.frontend2.impl;
import java.util.concurrent.CompletableFuture;
import org.webpieces.frontend2.api.FrontendSocket;
import org.webpieces.frontend2.api.ResponseStream;
import org.webpieces.frontend2.api.ServerSocketInfo;
import org.webpieces.frontend2.api.StreamListener;
import com.webpieces.http2.api.dto.highlevel.Http2Request;
import com.webpieces.http2.api.streaming.StreamWriter;
public class TimeoutHandler {
private StreamListener httpListener;
public TimeoutHandler(StreamListener httpListener) {
this.httpListener = httpListener;
}
public CompletableFuture incomingRequest(ResponseStream stream, Http2Request headers, ServerSocketInfo type) {
FrontendSocket socket = stream.getSocket();
//record last incoming data timestamp
//return httpListener.openStream(stream, headers, type);
return null;
}
public void connectionOpened(FrontendSocket channel, boolean isReadyForWrites) {
//start open connection timer
}
public void connectionClosedBeforeRequest(FrontendSocketImpl socket) {
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy