public final class ServerNetty extends Object implements be.yildiz.module.network.server.Server
Modifier and Type | Method and Description |
---|---|
static ServerNetty |
fromAddress(io.netty.bootstrap.ServerBootstrap bootstrap,
String address,
int port)
Create a new Netty server.
|
static ServerNetty |
fromPort(io.netty.bootstrap.ServerBootstrap bootstrap,
int port)
Create a new Netty server.
|
void |
startServer()
Start the server to listen to clients.
|
public static ServerNetty fromAddress(io.netty.bootstrap.ServerBootstrap bootstrap, String address, int port)
bootstrap
- Netty server bootstrap to use.address
- Address to expose to clients.port
- Port to expose to clients.public static ServerNetty fromPort(io.netty.bootstrap.ServerBootstrap bootstrap, int port)
bootstrap
- Netty server bootstrap to use.port
- Port to expose to clients.public void startServer()
startServer
in interface be.yildiz.module.network.server.Server
be.yildiz.module.network.exceptions.NetworkException
- If the server failed to start(port already used...).Copyright © 2014–2016. All rights reserved.