All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.webpieces.frontend2.impl.TimeoutHandler Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.1.1
Show newest version
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