Package org.ch3ck3r.jgbx.internal

Examples of org.ch3ck3r.jgbx.internal.RequestContainer


  @Override
  public void run() {
    logger.info("SenderThread is running");
    while (!this.shouldExit && this.jgbxc.isConnected()) {
      try {
        final RequestContainer requestC = this.requestQueue.poll(POLLING_TIMEOUT, TimeUnit.MILLISECONDS);
        if (requestC == null) {
          continue;
        }
       
        final String message = requestC.getRequest().toXML();
        logger.debug("Sending request: [" + message.length() + "] [" + requestC.getHandle() + "] " + message);
       
        final byte[] messageBytes = message.getBytes(Charset.forName("UTF-8"));
        final Integer messageLength = messageBytes.length;
        final byte[] messageLengthBytes = ByteOrderUtils.integerToLittleEndianess(messageLength);
        final byte[] messageHandleBytes = ByteOrderUtils.integerToLittleEndianess(requestC.getHandle());
       
        try {
          this.outputStream.write(messageLengthBytes);
          this.outputStream.write(messageHandleBytes);
          this.outputStream.write(messageBytes);
View Full Code Here


      }
    }
   
    try {
      this.responseQueue.put(handle, future);
      this.requestQueue.put(new RequestContainer(handle, request));
      if (request instanceof EnableCallbacksRequest) {
        this.callbacksEnabled = request.<Boolean> getParameter(0);
      }
    }
    catch (final InterruptedException e) {
View Full Code Here

TOP

Related Classes of org.ch3ck3r.jgbx.internal.RequestContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.