package com.sw.dualscreen.socket; public class LanServer { private static volatile LanCommunicationManager instance; public static LanCommunicationManager getInstance() { if (instance == null) { synchronized (LanServer.class) { if (instance == null) { instance = new LanCommunicationManager( 5000, // 监听端口 20, // 最大客户端数 10_000 // 心跳超时时间 10 秒 ); } } } return instance; } }