mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-03 13:28:44 +00:00
Testing server PINGs
This commit is contained in:
1 parent
1a17165227
commit
04b9ccca22
1 file changed
+2
-1
@@ -24,9 +24,10 @@
|
|||||||
out('DISCONNECTED');
|
out('DISCONNECTED');
|
||||||
};
|
};
|
||||||
websocket.onmessage = function(ev) {
|
websocket.onmessage = function(ev) {
|
||||||
|
if (!ev.data) return; // No data, this is a PING message, ignore it
|
||||||
out('<span style="color: blue;">RESPONSE: ' + ev.data + ' </span>');
|
out('<span style="color: blue;">RESPONSE: ' + ev.data + ' </span>');
|
||||||
num_messages++;
|
num_messages++;
|
||||||
if (num_messages > 3) {
|
if (num_messages > 100) {
|
||||||
websocket.send('exit');
|
websocket.send('exit');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user