View Javadoc

1   package ch.mimo.netty.example.icap.squidechoserver;
2   
3   import java.net.InetSocketAddress;
4   import java.util.concurrent.Executors;
5   
6   import org.jboss.netty.bootstrap.ServerBootstrap;
7   import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
8   
9   public class IcapServer {
10  
11  	private static final int SERVER_PORT = 1344;
12  	
13  	public static void main(String[] args) {
14          // Configure the server.
15          ServerBootstrap bootstrap = new ServerBootstrap(
16                  new NioServerSocketChannelFactory(
17                          Executors.newCachedThreadPool(),
18                          Executors.newCachedThreadPool()));
19  
20          // Set up the event pipeline factory.
21          bootstrap.setPipelineFactory(new IcapServerChannelPipeline());
22  
23          // Bind and start to accept incoming connections.
24          bootstrap.bind(new InetSocketAddress(SERVER_PORT));
25  	}
26  }