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