Pergunta

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.

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top