package config

import (
	"cicv-data-closedloop/common/config/c_log"
	"net"
	"os"
)

var KillSignalListener net.Listener

func InitKillSignalListener(serverIp string) {
	var err error
	c_log.GlobalLogger.Info("初始化RPC端口监听Kill信号 - 开始。")
	socket := serverIp + ":" + CloudConfig.RpcPort
	KillSignalListener, err = net.Listen("tcp", socket)
	if err != nil {
		c_log.GlobalLogger.Error("监听rpc端口失败:", err)
		os.Exit(-1)
	}
	c_log.GlobalLogger.Info("初始化RPC端口监听Kill信号 - 成功：", socket)
}
