Package org.springframework.web.socket.sockjs.frame

Examples of org.springframework.web.socket.sockjs.frame.SockJsMessageCodec


    }
  }

  @Override
  protected String[] readMessages(ServerHttpRequest request) throws IOException {
    SockJsMessageCodec messageCodec = getServiceConfig().getMessageCodec();
    MediaType contentType = request.getHeaders().getContentType();
    if (contentType != null && MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType)) {
      MultiValueMap<String, String> map = this.formConverter.read(null, request);
      String d = map.getFirst("d");
      return (StringUtils.hasText(d) ? messageCodec.decode(d) : null);
    }
    else {
      return messageCodec.decodeInputStream(request.getBody());
    }
  }
View Full Code Here


  @Override
  protected void flushCache() throws SockJsTransportFailureException {
    do {
      String message = getMessageCache().poll();
      SockJsMessageCodec messageCodec = getSockJsServiceConfig().getMessageCodec();
      SockJsFrame frame = SockJsFrame.messageFrame(messageCodec, message);
      writeFrame(frame);

      this.byteCount += frame.getContentBytes().length + 1;
      if (logger.isTraceEnabled()) {
View Full Code Here

  protected void flushCache() throws SockJsTransportFailureException {
    String[] messages = new String[getMessageCache().size()];
    for (int i = 0; i < messages.length; i++) {
      messages[i] = getMessageCache().poll();
    }
    SockJsMessageCodec messageCodec = getSockJsServiceConfig().getMessageCodec();
    SockJsFrame frame = SockJsFrame.messageFrame(messageCodec, messages);
    writeFrame(frame);
  }
View Full Code Here

TOP

Related Classes of org.springframework.web.socket.sockjs.frame.SockJsMessageCodec

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.