package com.yutou.biliapi.utils;

import org.java_websocket.client.WebSocketClient;
import org.java_websocket.handshake.ServerHandshake;

import java.net.URI;
import java.util.HashMap;
import java.util.Map;

public class LiveHeartBeat {
    private static LiveHeartBeat instance;
    private HeartBeatThread thread;
    Map<String,HeartBeatThread> heartBeatMap=new HashMap<>();

    public static LiveHeartBeat getInstance() {
        if (instance == null) {
            instance = new LiveHeartBeat();
        }
        return instance;
    }

    private LiveHeartBeat() {
    }

    public void addHeartBeat(String roomId) {
        if(heartBeatMap.containsKey(roomId)){
            return;
        }

    }

    public void removeHeartBeat(String roomId) {
    }

    public void endAllHeartBeat() {

    }

    public class HeartBeatThread extends WebSocketClient {


        public HeartBeatThread(URI serverUri) {
            super(serverUri);
        }

        @Override
        public void onOpen(ServerHandshake serverHandshake) {

        }

        @Override
        public void onMessage(String s) {

        }

        @Override
        public void onClose(int i, String s, boolean b) {

        }

        @Override
        public void onError(Exception e) {

        }
    }

}
