|
@@ -318,11 +318,9 @@ public class ServerMgr {
|
|
|
if (null == hc) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
if (null == hc.getPorts()) {
|
|
|
hc.setPorts(new HashMap<>());
|
|
|
}
|
|
|
-
|
|
|
hc.getPorts().put(port.getPortNum(), port);
|
|
|
addProxy(port);
|
|
|
ServerContainer.getContainer().listenPort(port);
|
|
@@ -402,7 +400,7 @@ public class ServerMgr {
|
|
|
return null;
|
|
|
}
|
|
|
InetSocketAddress addr = (InetSocketAddress) channel.localAddress();
|
|
|
- return Integer.valueOf(addr.getPort());
|
|
|
+ return addr.getPort();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -499,7 +497,7 @@ public class ServerMgr {
|
|
|
|
|
|
HolerMsg msg = new HolerMsg();
|
|
|
if (null != serialNum) {
|
|
|
- msg.setSerialNumber(serialNum.longValue());
|
|
|
+ msg.setSerialNumber(serialNum);
|
|
|
}
|
|
|
msg.setType(msgType);
|
|
|
holerChannel.writeAndFlush(msg);
|
|
@@ -737,14 +735,14 @@ public class ServerMgr {
|
|
|
public static Integer clientStatus(String key) {
|
|
|
Channel ch = getHolerChannel(key);
|
|
|
if (HolerUtil.isActive(ch)) {
|
|
|
- return Integer.valueOf(1);
|
|
|
+ return 1;
|
|
|
}
|
|
|
- return Integer.valueOf(0);
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
|
|
|
public static boolean isOnline(String key) {
|
|
|
- int status = clientStatus(key).intValue();
|
|
|
+ int status = clientStatus(key);
|
|
|
if (1 == status) {
|
|
|
return true;
|
|
|
}
|
|
@@ -753,7 +751,7 @@ public class ServerMgr {
|
|
|
|
|
|
|
|
|
public static Long countOnlineClient() {
|
|
|
- Long online = Long.valueOf(0L);
|
|
|
+ Long online = 0L;
|
|
|
if (MapUtils.isEmpty(holerChannels)) {
|
|
|
return online;
|
|
|
}
|
|
@@ -761,9 +759,9 @@ public class ServerMgr {
|
|
|
Set<Map.Entry<String, HolerChannel>> entries = holerChannels.entrySet();
|
|
|
for (Map.Entry<String, HolerChannel> entry : entries) {
|
|
|
|
|
|
- if (1 == clientStatus((String) entry.getKey()).intValue()) {
|
|
|
+ if (1 == clientStatus((String) entry.getKey())) {
|
|
|
|
|
|
- Long long1, long2 = online = (long1 = online).valueOf(online.longValue() + 1L);
|
|
|
+ Long long1, long2 = online + 1L;
|
|
|
// long1;
|
|
|
}
|
|
|
}
|