Re: strange SocketChannel
Just guessing here - but could something be retaining a reference to the old, dead socket and not being updated when the connection is "refreshed"?
Re: strange SocketChannel
Quote:
I don't know why the object refreshed in one thread is open locally, while accessed in another, it seems the value of it has been changed.
Anyone has any idea ?
Without seeing the code it's impossible to say what's wrong but, as AlexVV has already suggested, in all probability there are two different objects involved rather than a different result from the same object.
BTW If accessing a variable from 2 different threads make sure you are declaring the variable as volatile.