Example #1
0
    public SessionListener(Session session) {
      m_session = session;

      System.out.println(
          "PubClient: connected "
              + session.getLocalAddress()
              + " -> "
              + session.getRemoteAddress());

      final ByteBuffer buf = ByteBuffer.allocateDirect(5);
      buf.putInt(5);
      buf.put((byte) 0);
      buf.position(0);
      session.sendData(buf);
    }