Package org.jwebsocket.kit

Examples of org.jwebsocket.kit.RawPacket


                        frameStart = true;
                    } else if (b == 0xff && frameStart == true) {
                        frameStart = false;

                        WebSocketClientEvent lWSCE = new WebSocketClientTokenEvent();
                        RawPacket lPacket = new RawPacket(baos.toByteArray());

                        baos.reset();
                        notifyPacket(lWSCE, lPacket);
                    } else if (frameStart == true) {
                        // messageBytes.add((byte) b);
View Full Code Here


  public static WebSocketPacket tokenToPacket(Token aToken) {
    WebSocketPacket lPacket = null;
    try {
      JSONObject lJSON = aToken.getJSONObject();
      String lData = lJSON.toString();
      lPacket = new RawPacket(lData, "UTF-8");
    } catch (UnsupportedEncodingException ex) {
      // TODO: process exception
      // log.error(ex.getClass().getSimpleName() + ": " + ex.getMessage());
    }
    return lPacket;
View Full Code Here

                    lKey + "=" + objectToCSV(lVal)
                    + (lIterator.hasNext() ? "," : "");
        }
        WebSocketPacket lPacket = null;
        try {
            lPacket = new RawPacket(lData, "UTF-8");
        } catch (UnsupportedEncodingException ex) {
            // TODO: process exception
            // log.error(ex.getClass().getSimpleName() + ": " + ex.getMessage());
        }
        return lPacket;
View Full Code Here

   * @param aConnector
   * @param aObject
   */
  protected void processConnector(WebSocketConnector aConnector, Object aObject) {
    try {
      aConnector.sendPacket(new RawPacket(aObject.toString()));
    } catch (Exception ex) {
      log.error(ex.getClass().getSimpleName() + ": " + ex.getMessage());
    }
  }
View Full Code Here

              lStart = 0;
              // end of frame
            } else if (b == 0xff) {
              if (lStart >= 0) {
                if (pos <= lMaxFrameSize) {
                  RawPacket lPacket = new RawPacket(Arrays.copyOf(lBuff, pos));
                  try {
                    engine.processPacket(connector, lPacket);
                  } catch (Exception ex) {
                    mLog.error(ex.getClass().getSimpleName()
                        + " in processPacket of connector "
View Full Code Here

        } else if (msg.isText()) {
            textData = msg.getTextData();
        } else {
            throw new WebSocketRuntimeException("Frame Doesn't contain any type of data");
        }
        engine.processPacket(connector, new RawPacket(textData));
    }
View Full Code Here

TOP

Related Classes of org.jwebsocket.kit.RawPacket

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.