学习笔记-WebSocketServer 实现K线推送

`package com.app.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**

  • @Admin fyx

  • 2020年5月14日10:30:53

  • 开启WebSocket支持
    */
    @Configuration
    public class WebSocketCofig {

    @Bean
    ServerEndpointExporter serverEndpointExporter() {
    return new ServerEndpointExporter();
    }
    }``java

package com.app.server;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.app.client.SubscriptionClient;
import com.app.client.SubscriptionOptions;
import com.app.client.model.Candlestick;
import com.app.pojo.Tick;
import com.app.service.ConfigService;
import com.app.service.impl.ConfigServiceImpl;
import com.app.utils.SwatchUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.concurrent.CopyOnWriteArraySet;

@Component
@Scope(“prototype”)
@ServerEndpoint("/test/test/test/{sy

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
负载平衡,MQTT协议支持,修正大量Bug,最新稳定版 Delphi7/XE6/XE7/XE8 ******************************************************* sgcWebSockets ******************************************************* [*] : Bug [+] : New [-] : Deleted [/] : Breaking changes Versions -------- 4.1.0: 2017 April [+] : Added support for Rad Studio 10.2 Tokyo. [+] : Added support for Linux compiler. [+] : MQTT client, added subscribe method. [+] : MQTT client, added unsubscribe method. [+] : MQTT client, added publish method. [+] : MQTT client, added Authentication property, allows to set user and password to authenticate against MQTT Server. [+] : MQTT client, added HeartBeat property, keeps alive connection. [+] : MQTT client, added LastWillTestament property, when client disconnects, sends a message to other connected clients. [+] : New Property "NotifyDeletes" in Dataset Server Protocol, if enabled (by default) broadcast deleted record to all clients. [+] : New Method "BroadcastRecord" in Dataset Server Protocol, sends dataset record values to all clients. [+] : New Method "MetaData" in Dataset Server Protocol, sends metadata info to a single client. [+] : New Method "Synchronize" in Dataset Server Protocol, sends dataset record values to a single client. [*] : Fixed Bug ReadTimeout and ConnectionTimeout in client component. [*] : Added Guid property to Client File Protocol. [*] : Fixed Bug Invalid Character when trying to access to built-in javascript libraries. [*] : Fixed Bug File Protocol when BufferSize was set to zero, file was not saved properly. [*] : Fixed Memory Leaks on NextGen compiler. [*] : Fixed WebRTC Chrome console errors.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值