19,610
社区成员
发帖
与我相关
我的任务
分享
ps -ef | grep java //查看java进程id
lsof -n | grep 27343 -c// 查看java打开的句柄数量
lsof -p 27343 // 查看详细打开的句柄
[root@iZ2572449s4Z ~]# lsof -n | grep 27343 -c
2136
2017-08-10 12:38:37 ——> 2136
2017-08-10 14:38:37 ——> 3489
2017-08-10 18:38:37 ——> 3691
2017-08-10 18:51:37 ——> 3752
2017-08-10 20:47:37 ——> 4229
2017-08-10 22:12:37 ——> 4508
2017-08-11 18:25:37 ——> 7899
2017-08-12 11:20:00 ——> 10465
[root@iZ2572449s4Z ~]# ulimit -n
65535
3, 122.192.13.192
58, 101.226.102.139
3, 122.192.12.64
3, 49.92.118.42
3, 122.192.12.62
3, 49.92.118.46
43, 101.226.102.140
55, 101.226.102.141
3, 49.92.103.66
2, 101.90.127.161
2, 122.192.14.28
6, 122.192.13.185
2, 122.192.12.252
3, 122.192.12.254
3, 122.192.12.71
4, 112.86.84.247
2, 122.192.13.176
3, 49.92.194.115
3, 122.192.13.177
6, 122.192.13.178
2, 222.93.49.223
2, 58.219.202.6
5, 122.192.14.39
1, 112.117.86.36
3, 36.23.51.152
3, 122.192.14.43
2, 122.192.14.44
3, 122.192.14.48
2, 114.216.124.122
3, 49.92.76.195
3, 122.192.12.43
3, 122.192.14.40
2, 122.192.12.41
2, 49.92.151.212
2, 183.208.193.73
2, 122.192.12.48
3, 49.95.215.178
21, 140.207.54.187
3, 122.192.15.184
2, 49.92.193.90
18, 140.207.54.180
3, 117.136.66.81
1, 180.107.192.164
3, 49.92.178.157
4, 49.92.169.213
2, 122.192.15.178
18, 140.207.54.199
20, 140.207.54.198
3, 122.192.15.173
15, 140.207.54.197
2, 180.103.244.86
3, 58.211.125.50
3, 117.136.68.19
8, 49.64.44.223
2, 223.64.78.51
14, 117.136.68.18
1, 121.228.76.116
7, 117.136.68.17
2, 121.224.51.191
3, 49.95.190.19
3, 117.136.68.21
2, 113.57.244.212
1, 49.85.219.2
9, 117.136.68.22
9, 117.136.68.20
3, 117.136.68.25
4, 49.84.204.122
2, 117.136.68.26
5, 117.136.68.23
7, 117.136.68.24
3, 117.136.66.63
1, 121.228.41.98
3, 122.192.14.209
3, 49.95.184.139
2, 180.107.142.53
1, 49.92.164.175
3, 49.95.167.117
3, 112.96.170.212
10, 117.136.68.10
8, 117.136.68.11
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<div id="layout" class="content">
`t business_homemenu()
`doLayout`
`get contents
</div>
<audio autoplay="autoplay" src="" id="audiodivtip">
您的浏览器不支持自动语音播报
</audio>
</body>
<script>
console.log("socket connecting...");
// Message received on the socket
// Create a socket
var WS = window['MozWebSocket'] ? MozWebSocket : WebSocket;
var socket = new WS('${session.get("notificationUrl")}');
socket.onmessage = function(event) {
$.messager.alert({msg: "有新的订单,请确认并处理"});
console.log(event.data);
var jsonobj = eval('(' + event.data + ')');
$("#audiodivtip").attr("src", jsonobj.tipAudioSrc);
if ($('#handlingListDIV').length > 0) {
Handling.newOrder(jsonobj);
}
}
socket.onclose = function(event) {
console.log("socket closed, start to refresh page");
window.location.reload();
}
socket.onError = function(event) {
console.log("socket error, start to refresh page");
window.location.reload();
}
window.onunload = function() {
console.log("离开页面,即将关闭socket..")
socket.close();
}
</script>
</html>
目前猜的:
之前页面关了就不管了,现在在页面关闭或者刷新的时候做了socket.close();