mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2025-07-05 09:20:20 -04:00
Removed socket delays to reduce latency
This commit is contained in:
parent
4dcd961d5e
commit
6442e8d6b0
2 changed files with 5 additions and 0 deletions
lib
|
@ -22,6 +22,9 @@ Client.prototype.setSocket = function(socket) {
|
|||
var self = this;
|
||||
self.socket = socket;
|
||||
var incomingBuffer = new Buffer(0);
|
||||
|
||||
self.socket.setNoDelay();
|
||||
|
||||
self.socket.on('data', function(data) {
|
||||
if (self.encryptionEnabled) data = new Buffer(self.decipher.update(data), 'binary');
|
||||
incomingBuffer = Buffer.concat([incomingBuffer, data]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue