Closed Tochemey closed 8 years ago
_authenticated
is just a field on an object. There is no magic in DotNetty. Field will hold true
when it is set to true
. From your example it isn't clear how it is being accessed.
I figured it out how to access it by using the following sample code:
var handler = (EslClientHandler) _channel.Pipeline.Last();
Authenticated = handler.Authenticated;
Hello,
I am having a little challenge on how to store a state property on a handler and get the value of that state when needed. Let me paint a simple scenario. Assuming we have a client connecting to a remote server. When the connection is successful then the client sends some authentication message to the remote peer to get authenticated. This authentication can only be done when the remote peer requests for it during the connection process. This is the sample code I have written so far but I do not know how to get the _authenticated value because anytime I want to access it it is false but when I debug it is set to true.