| | |
| | | /** |
| | | * instance |
| | | */ |
| | | private volatile static HDLAuthSocket instance; |
| | | private static final HDLAuthSocket instance=new HDLAuthSocket(); |
| | | |
| | | private HDLAuthSocket() { |
| | | initListenerGatewayEvent(); |
| | |
| | | * |
| | | * @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; |
| | | } |
| | | |
| | |
| | | * |
| | | * @return 返回当前对象 |
| | | */ |
| | | private UdpSocketBoot getUdpBoot() { |
| | | private synchronized UdpSocketBoot getUdpBoot() { |
| | | try { |
| | | if (udpSocketBoot == null) { |
| | | udpSocketBoot = UdpClient.init(UDP_PORT, getUdpOptions()); |