Reputation: 4820
I'm working with nio (non blocking mode).
when the server is down, and I'm trying to connect (after I'm getting isConnectable
key) i'm getting the following exception: java.nio.channels.ClosedChannelException
.
Every 1 second, I'm trying to reconnect to the server (via connect method) and getting the same exception: java.nio.channels.ClosedChannelException
.
When the server is up , I'm getting the same exception and cant connect to the server.
Thanks
Upvotes: 1
Views: 5749
Reputation: 311039
The SocketChannel is closed. You closed it, in your code, and then continued to use it. Or possibly you overlooked a ConnectException
.
Upvotes: 1