DefaultHttpServerConnection conn =
new DefaultHttpServerConnection();
conn.bind(socket, serverParams);
// Set up the HTTP service
HttpService httpService = new HttpService(
httpProcessor,
new DefaultConnectionReuseStrategy(),
new DefaultHttpResponseFactory());
httpService.setParams(serverParams);
httpService.setHandlerResolver(handlerRegistry);
// Start worker thread
Thread t = new Thread(new Worker(httpService, conn));
workerThreads.add(t);
t.setDaemon(true);