Question

I looked at some of the source code in Netty 4.0 and I noticed that AbstractChannel's localAddress and remoteAddress are volatile, and not final.

Are these addresses guaranteed to be set and available when channelActive is triggered?

And, more importantly, what do localAddress() and remoteAddress() return when/after channelInactive is triggered? Do channels keep the addresses, even after the connection is closed?

I'm working with the NIO channels, and mostly on Windows, if it makes any difference.

Était-ce utile?

La solution

These are set lazy, which means basically the first time you try to access them.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top