Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: cd63189afb
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (28 sloc) 1.132 kB
package com.something.lift
import org.jboss.netty.channel.group.DefaultChannelGroup
import org.jboss.netty.handler.codec.http.{HttpResponseEncoder, HttpRequestDecoder}
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory
import java.util.concurrent.Executors
import org.jboss.netty.bootstrap.ServerBootstrap
import java.net.InetSocketAddress
import org.jboss.netty.channel.ChannelFactory
/**
* Created by IntelliJ IDEA.
* User: jordanrw
* Date: 2/22/12
* Time: 10:04 PM
*/
object LiftNettyExampleServer extends App {
val allChannels = new DefaultChannelGroup("lift-netty-example-server")
private[this] val factory: ChannelFactory = new NioServerSocketChannelFactory(
Executors.newCachedThreadPool(),
Executors.newCachedThreadPool()
)
private[this] val bootstrap = new ServerBootstrap(factory)
bootstrap.setPipelineFactory(new LiftPipelineFactory)
bootstrap.setOption("child.tcpNoDelay", true)
bootstrap.setOption("child.keepAlive", true)
val boundChannel = bootstrap.bind(new InetSocketAddress(8080))
println("Lift-Netty Server Started")
allChannels.add(boundChannel)
}
Jump to Line
Something went wrong with that request. Please try again.