private void reset(int op) {
    done();
    _buffer.reset();
    set(_buffer);

    _id = ID.getAndIncrement();

    writeInt(0); // length: will set this later
    writeInt(_id);
    writeInt(0); // response to
    writeInt(op);
  }
Esempio n. 2
0
 public ContinuousChangesFeed(String dbName, HttpResponse httpResponse) {
   this.httpResponse = httpResponse;
   try {
     reader = new BufferedReader(new InputStreamReader(httpResponse.getContent(), "UTF-8"));
     thread.setName(
         String.format(
             "ektorp-%s-changes-listening-thread-%s", dbName, THREAD_COUNT.getAndIncrement()));
     thread.start();
   } catch (UnsupportedEncodingException e) {
     throw Exceptions.propagate(e);
   }
 }
  void append(String db, WriteConcern c) {

    _id = ID.getAndIncrement();

    int loc = size();

    writeInt(0); // will set this later
    writeInt(_id);
    writeInt(0); // response to
    writeInt(2004);
    _appendQuery(0, db + ".$cmd", 0, -1, c.getCommand(), null);
    _buf.writeInt(loc, size() - loc);
  }
Esempio n. 4
0
 /** ************************************************************************* Gwt Server */
 public GwtServer() {
   m_context = new GWTServerContext();
   m_context.setContext(MRole.GWTSERVERID, s_gwtServer_ID.getAndIncrement());
 } // GwtServer
 public void sendMessage(List<String> params) {
   // increment our local receive counter
   counter.getAndIncrement();
   ServiceUtils.invokeOnConnection(conn, "receiveMessage", params.toArray());
 }