public class NettyClient
extends java.lang.Object
NettyServer
Modifier and Type | Field and Description |
---|---|
private io.netty.bootstrap.Bootstrap |
bootstrap |
private io.netty.channel.ChannelFuture |
channelFuture |
private io.netty.channel.EventLoopGroup |
workerGroup |
Constructor and Description |
---|
NettyClient(LocalHost localHost,
java.lang.String host,
int port,
ConnectListener connectListener)
Creates client that connect to server on specified host and port.
|
Modifier and Type | Method and Description |
---|---|
void |
start()
Connects the client to server
Note: method does not block
|
void |
stop()
Closes connection to server
Note: method does not block
|
private final io.netty.channel.EventLoopGroup workerGroup
private final io.netty.bootstrap.Bootstrap bootstrap
private io.netty.channel.ChannelFuture channelFuture
public NettyClient(LocalHost localHost, java.lang.String host, int port, ConnectListener connectListener)
host
- the host where server listens onport
- the port that server listens on