| 87 |
Kevin |
1 |
/**************************************************************************
|
|
|
2 |
* Copyright 2011 Jules White
|
|
|
3 |
*
|
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
|
6 |
* You may obtain a copy of the License at
|
|
|
7 |
*
|
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
9 |
*
|
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13 |
* See the License for the specific language governing permissions and
|
|
|
14 |
* limitations under the License.
|
|
|
15 |
***************************************************************************/
|
|
|
16 |
package org.vt.ece4564.latmb;
|
|
|
17 |
|
|
|
18 |
import java.net.InetSocketAddress;
|
|
|
19 |
import java.util.concurrent.Executors;
|
|
|
20 |
|
|
|
21 |
import org.jboss.netty.bootstrap.ServerBootstrap;
|
|
|
22 |
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
|
|
|
23 |
|
|
|
24 |
public class LATMBServer {
|
|
|
25 |
|
|
|
26 |
public static void main(String[] args) throws Exception {
|
|
|
27 |
// Configure the server.
|
|
|
28 |
ServerBootstrap bootstrap = new ServerBootstrap(
|
|
|
29 |
new NioServerSocketChannelFactory(
|
|
|
30 |
Executors.newCachedThreadPool(),
|
|
|
31 |
Executors.newCachedThreadPool()));
|
|
|
32 |
|
|
|
33 |
// Configure the pipeline factory.
|
|
|
34 |
bootstrap.setPipelineFactory(new LATMBServerPipelineFactory());
|
|
|
35 |
|
|
|
36 |
// Bind and start to accept incoming connections.
|
|
|
37 |
bootstrap.bind(new InetSocketAddress(8080));
|
|
|
38 |
|
|
|
39 |
|
|
|
40 |
}
|
|
|
41 |
}
|