public final class NettyConnection extends Object implements ClientConnection
| Constructor and Description |
|---|
NettyConnection(Client.WithManagement client,
@NonNull io.netty.channel.ChannelFuture channelFuture,
@NonNull Consumer<Client.WithManagement> shutdownHook)
Constructs a Netty connection.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isAlive()
Gets if the connection is alive.
|
void |
shutdown(DefaultMessageType messageType,
boolean reconnect)
Shuts down with a message type.
|
void |
shutdown(@Nullable String message,
boolean reconnect)
Shuts down with a message.
|
void |
startPing()
Starts sending pings.
|
@NonNull String |
toString() |
public NettyConnection(Client.WithManagement client, @NonNull io.netty.channel.ChannelFuture channelFuture, @NonNull Consumer<Client.WithManagement> shutdownHook)
client - client for which this existschannelFuture - channel future from which to handle the connectionshutdownHook - consumer to call when shut downpublic boolean isAlive()
ClientConnectionisAlive in interface ClientConnectionpublic void startPing()
ClientConnectionstartPing in interface ClientConnectionpublic void shutdown(DefaultMessageType messageType, boolean reconnect)
ClientConnectionshutdown in interface ClientConnectionmessageType - message typereconnect - true to indicate desire to reconnectpublic void shutdown(@Nullable String message, boolean reconnect)
ClientConnectionshutdown in interface ClientConnectionmessage - messagereconnect - true to indicate desire to reconnectCopyright © 2013–2021 Kitteh. All rights reserved.