chrome-net
Advanced tools
Comparing version 2.2.2 to 2.2.3
20
index.js
@@ -455,2 +455,7 @@ /** | ||
chrome.sockets.tcp.create(function (createInfo) { | ||
if (self.destroyed) { | ||
chrome.sockets.tcp.close(createInfo.socketId) | ||
return | ||
} | ||
self.id = createInfo.socketId | ||
@@ -653,8 +658,13 @@ | ||
chrome.sockets.tcp.disconnect(self.id, function () { | ||
chrome.sockets.tcp.close(self.id, function () { | ||
self.emit('close', !!exception) | ||
fireErrorCallbacks() | ||
// if _destroy() has been called before chrome.sockets.tcp.create() | ||
// callback, we don't have an id. Therefore we don't need to close | ||
// or disconnect | ||
if (self.id) { | ||
chrome.sockets.tcp.disconnect(self.id, function () { | ||
chrome.sockets.tcp.close(self.id, function () { | ||
self.emit('close', !!exception) | ||
fireErrorCallbacks() | ||
}) | ||
}) | ||
}) | ||
} | ||
} | ||
@@ -661,0 +671,0 @@ |
{ | ||
"name": "chrome-net", | ||
"description": "Use the Node `net` API in Chrome Apps", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"author": "Feross Aboukhadijeh <feross@feross.org> (http://feross.org/)", | ||
@@ -6,0 +6,0 @@ "bugs": { |
Sorry, the diff of this file is too big to display
210655
6224