I just upgraded projectreactor.io from reactor OLD: [core: 3.0.1.RELEASE, netty: 0.5.2.RELEASE] to reactor NEW [core: 3.0.4.RELEASE, netty: 0.6.0.RELEASE].
I open a TcpClient connection and want to close it later.
In the OLD version I used
tcpClient.shutdown();
to disconnect my client from the server.
Is there an equivalent call in the NEW version? I could not find one!
I tried the following on both the NettyInbound
and NettyOutbound
that I get while creating my TcpClient with tcpClient.newHandler(...)
.context().dispose()
.context().channel().disconnect()
.context().channel().close()
TcpResources.reset()
None of them seem to do the job correctly.
I noticed that the respective .context().onClose(...)
-callback is being called.
But after some additional waiting the server-side checks the connections.
Server-side is plain NIO2 not reactor/netty and while the client was upgraded, the server-side remained unchanged.
With the OLD client I got .isOpen() == false
for every channel on server-side.
With the NEW client I get .isOpen() == true
for every channel on server-side. Most of the time I can even write to the channel. And some channels switch to .isOpen() == false
after writing few bytes.