hxb
2022-03-27 cc6023291bc94a229b53d7c2d83bf2b39bbfa9a0
HDLSDK/hdl-connect/src/main/java/com/hdl/sdk/connect/socket/HDLAuthSocket.java
@@ -68,7 +68,7 @@
    /**
     * instance
     */
    private volatile static HDLAuthSocket instance;
    private  static final HDLAuthSocket instance=new HDLAuthSocket();
    private HDLAuthSocket() {
        initListenerGatewayEvent();
@@ -84,14 +84,14 @@
     *
     * @return HDLAuthSocket
     */
    public static synchronized HDLAuthSocket getInstance() {
        if (instance == null) {
            synchronized (HDLLinkConfig.class) {
                if (instance == null) {
                    instance = new HDLAuthSocket();
                }
            }
        }
    public  static HDLAuthSocket getInstance() {
//        if (instance == null) {
//            synchronized (HDLAuthSocket.class) {
//        if (instance == null) {
//            instance = new HDLAuthSocket();
//        }
//            }
//        }
        return instance;
    }
@@ -110,7 +110,7 @@
     *
     * @return 返回当前对象
     */
    private UdpSocketBoot getUdpBoot() {
    private synchronized UdpSocketBoot getUdpBoot() {
        try {
            if (udpSocketBoot == null) {
                udpSocketBoot = UdpClient.init(UDP_PORT, getUdpOptions());