Hi
I have server connects with two client c1, c2 via MINA. I want to send some
data from the server to c1 only. BUT when I do that, the server send the
data to BOTH clients c1 and c2. I use different port number 9999 to client
c1, 7777 to client c2, and I put one serverHandler for both.  below is a
function in serverHandler that send data to clients.

@Override
    public void sessionOpened(final IoSession session) throws Exception
    {

        new Timer().schedule(
                new TimerTask() {
                    @Override
                    public void run() {
                        if (SwitchId != null){

session.getConfig().setIdleTime(IdleStatus.BOTH_IDLE, 10);
                        session.setAttribute("Values: ");
                        session.write(SwitchId);
                        }
                    }
                },
               30000
            );

            }

Reply via email to