From a3cf8b090b673f96b155734221b42631619eea55 Mon Sep 17 00:00:00 2001 From: Andrew Naylor Date: Sat, 3 Dec 2011 21:15:35 +0000 Subject: [PATCH] Fixes #16 Fix by @bobrik --- lib/apn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/apn.js b/lib/apn.js index deb90f7..49e9ec6 100644 --- a/lib/apn.js +++ b/lib/apn.js @@ -48,7 +48,7 @@ var Connection = function (optionArgs) { } var onDrain = function() { - if (writeBuffer.length) { + while (writeBuffer.length && self.socket.bufferSize == 0) { writeNotificationToSocket(writeBuffer.shift()); } };