Hi everyone.
I want to send value from server to client, I call function
recevieFromSuperController in my class and send the value via it.
serverHandler handler = new serverHandler();
handler.recevieFromSuperController(requiedSwitch);
in server handler:
private SocketAddress SwitchId ;
public void recevieFromSuperController(SocketAddress s)
{
this.SwitchId = s;
System.out.println(SwitchId); // switchId = the value that I want
to send.
}
when I want to write the value to the client, the value is equal null !
public void sessionOpened(final IoSession session) throws Exception
{
System.out.println(SwitchId); // switchId = null here
session.write(SwitchId);
}
can anyone tell me why the value become null?