ericz пре 12 година
родитељ
комит
8ae567a9a7
1 измењених фајлова са 4 додато и 4 уклоњено
  1. 4 4
      lib/connection.js

+ 4 - 4
lib/connection.js

@@ -12,7 +12,7 @@ function DataConnection(id, peer, socket, cb, options) {
   this._options = options;
   
   // Connection is not open yet
-  this._open = false;
+  this.open = false;
   
   this._id = id;
   this._peer = peer;
@@ -131,7 +131,7 @@ DataConnection.prototype._configureDataChannel = function() {
   }
   this._dc.onopen = function() {
     util.log('Data channel connection success');
-    self._open = true;
+    self.open = true;
     self._callback(null, self);
   };
   this._dc.onmessage = function(e) {
@@ -244,7 +244,7 @@ DataConnection.prototype._handleDataMessage = function(e) {
 DataConnection.prototype.close = function(reason) {
   this._cleanup();
   var self = this;
-  if (this._open) {
+  if (this.open) {
     this._socket.send({
       type: 'LEAVE',
       dst: self._peer,
@@ -253,7 +253,7 @@ DataConnection.prototype.close = function(reason) {
   } else {
     this._callback(reason);
   }
-  this._open = false;
+  this.open = false;
 };