@Override public void run() { while (running) { try { final Socket es = esocket.accept(); if (stop.exists()) { esocket.close(); break; } final BufferInput bi = new BufferInput(es.getInputStream()); final long id = Token.toLong(bi.readString()); for (final ClientListener s : context.sessions) { if (s.getId() == id) { s.register(es); break; } } } catch (final IOException ex) { break; } } }
@Override public long textItr(final int pre, final boolean text) { return Token.toLong(text(pre, text)); }