fixed latency
This commit is contained in:
parent
111b4a1bb0
commit
76b80a3ddb
@ -112,7 +112,7 @@ function Node()
|
|||||||
console.warn('We are scheduling a reconnect operation', opts);
|
console.warn('We are scheduling a reconnect operation', opts);
|
||||||
})
|
})
|
||||||
.on('node-pong', function(data) {
|
.on('node-pong', function(data) {
|
||||||
var latency = (new Date()).getTime() - self._latency;
|
var latency = Math.ceil(((new Date()).getTime() - self._latency)/2);
|
||||||
socket.emit('latency', { id: self.id, latency: latency });
|
socket.emit('latency', { id: self.id, latency: latency });
|
||||||
})
|
})
|
||||||
.on('data', function incoming(data) {
|
.on('data', function incoming(data) {
|
||||||
|
Loading…
Reference in New Issue
Block a user