public abstract class NettyPlcConnection extends AbstractPlcConnection
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
awaitSessionSetupComplete |
protected io.netty.channel.Channel |
channel |
protected ChannelFactory |
channelFactory |
protected boolean |
connected |
protected static io.netty.util.Timer |
timer
a
HashedWheelTimer shall be only instantiated once. |
| Modifier | Constructor and Description |
|---|---|
protected |
NettyPlcConnection(ChannelFactory channelFactory) |
protected |
NettyPlcConnection(ChannelFactory channelFactory,
boolean awaitSessionSetupComplete) |
| Modifier and Type | Method and Description |
|---|---|
protected <T> T |
checkInternal(Object o,
Class<T> clazz)
Can be used to check and cast a parameter to its required internal type (can be used for general type checking too).
|
void |
close() |
void |
connect() |
io.netty.channel.Channel |
getChannel() |
protected abstract io.netty.channel.ChannelHandler |
getChannelHandler(CompletableFuture<Void> sessionSetupCompleteFuture) |
boolean |
isConnected() |
protected void |
sendChannelCreatedEvent() |
canRead, canSubscribe, canWrite, getMetadata, readRequestBuilder, subscriptionRequestBuilder, unsubscriptionRequestBuilder, writeRequestBuilderprotected static final io.netty.util.Timer timer
HashedWheelTimer shall be only instantiated once.protected final ChannelFactory channelFactory
protected final boolean awaitSessionSetupComplete
protected io.netty.channel.Channel channel
protected boolean connected
protected NettyPlcConnection(ChannelFactory channelFactory)
protected NettyPlcConnection(ChannelFactory channelFactory, boolean awaitSessionSetupComplete)
public void connect()
throws PlcConnectionException
PlcConnectionExceptionpublic void close()
throws PlcConnectionException
PlcConnectionExceptionpublic boolean isConnected()
public io.netty.channel.Channel getChannel()
protected abstract io.netty.channel.ChannelHandler getChannelHandler(CompletableFuture<Void> sessionSetupCompleteFuture)
protected void sendChannelCreatedEvent()
protected <T> T checkInternal(Object o, Class<T> clazz)
T - the type of the expected clazz.o - the object to be checked against target clazz.clazz - the expected clazz.clazz.Copyright © 2017–2018 The Apache Software Foundation. All rights reserved.