mirror of
https://github.com/Nan1t/NanoLimbo.git
synced 2026-02-10 10:56:13 +01:00
Moved from Gitlab
This commit is contained in:
24
src/main/java/ru/nanit/limbo/server/LimboServer.java
Normal file
24
src/main/java/ru/nanit/limbo/server/LimboServer.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package ru.nanit.limbo.server;
|
||||
|
||||
import io.netty.bootstrap.ServerBootstrap;
|
||||
import io.netty.channel.nio.NioEventLoopGroup;
|
||||
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
||||
import ru.nanit.limbo.LimboConfig;
|
||||
import ru.nanit.limbo.connection.ClientChannelInitializer;
|
||||
import ru.nanit.limbo.util.Logger;
|
||||
|
||||
public final class LimboServer {
|
||||
|
||||
public void start() throws Exception {
|
||||
Logger.info("Starting server...");
|
||||
|
||||
ServerBootstrap bootstrap = new ServerBootstrap()
|
||||
.group(new NioEventLoopGroup(), new NioEventLoopGroup())
|
||||
.channel(NioServerSocketChannel.class)
|
||||
.childHandler(new ClientChannelInitializer(this));
|
||||
|
||||
bootstrap.bind(LimboConfig.getHost(), LimboConfig.getPort());
|
||||
Logger.info("Server started on %s:%d", LimboConfig.getHost(), LimboConfig.getPort());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user