Moved from Gitlab

This commit is contained in:
Nanit
2020-11-25 19:16:28 +02:00
commit ccedd3a160
31 changed files with 2250 additions and 0 deletions

View 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());
}
}