T - the underlying data typepublic interface NettyTcpClient<T>
| Modifier and Type | Method and Description |
|---|---|
NettyTcpClient<T> |
setConnectionCallback(INettyConnectionCallback cb)
Request to be told upon connection/disconnection with the target server.
|
NettyTcpClient<T> |
setName(String name)
Associate a name to the client.
|
NettyTcpClient<T> |
start()
Start the client.
|
NettyTcpClient<T> |
stop()
Stop the client.
|
boolean |
write(T data)
Write some line of data to the server.
|
boolean |
write(T data,
Object context)
Write some line of data to the server using an acknowledgement mode.
|
boolean write(T data) throws NettyException
data - the data to sendNettyException - if the client queue capacity is reached and the connection to the server is down for more than
the configured timeout.boolean write(T data, Object context) throws NettyException
data - the data to sendcontext - some opaque context you need for the ack or fail callback.NettyException - if the client queue capacity is reached and the connection to the server is down for more than
the configured timeout.NettyTcpClient<T> start()
NettyTcpClient<T> stop()
NettyTcpClient<T> setConnectionCallback(INettyConnectionCallback cb)
It can be null and will have no effect.
cb - the user callbackNettyTcpClient<T> setName(String name)
name - the client nameCopyright © 2023. All rights reserved.