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

org.zbus.net.http.MessageServer Maven / Gradle / Ivy

There is a newer version: 7.2.2
Show newest version
package org.zbus.net.http;

import java.util.List;

import org.zbus.net.CodecInitializer;
import org.zbus.net.IoDriver;
import org.zbus.net.tcp.TcpServer;

import io.netty.channel.ChannelHandler;
import io.netty.handler.codec.http.HttpObjectAggregator;
import io.netty.handler.codec.http.HttpServerCodec;

public class MessageServer extends TcpServer { 
	public MessageServer() {
		this(null);
	}

	public MessageServer(final IoDriver driver) {
		super(driver);  
		codec(new CodecInitializer() {
			@Override
			public void initPipeline(List p) {
				p.add(new HttpServerCodec());
				p.add(new HttpObjectAggregator(getIoDriver().getPackageSizeLimit()));
				p.add(new MessageToHttpWsCodec());
			}
		}); 
	} 
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy