summaryrefslogtreecommitdiff
path: root/threads.js
diff options
context:
space:
mode:
authorCode WvS <code-wvs@quantentunnel.de>2015-03-20 20:54:17 +0100
committerCode WvS <code-wvs@quantentunnel.de>2015-03-20 20:54:17 +0100
commit4fb62473dff7618bc340ff6825ca9663eea0a42a (patch)
treea2163fdd93a3a587c93c698277f1f9de590c274d /threads.js
parent4f8b0e5b8c72a951aa7f240eee8fc266ee03cac5 (diff)
parent121cf8b3658909f79571b621e9a9916c7f601dfc (diff)
downloadsnap-yow-4fb62473dff7618bc340ff6825ca9663eea0a42a.tar.gz
snap-yow-4fb62473dff7618bc340ff6825ca9663eea0a42a.zip
Merge branch 'p2p' of ../Snap--Build-Your-Own-Blocks into gh-pages
Diffstat (limited to 'threads.js')
-rw-r--r--threads.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/threads.js b/threads.js
index 1938f5f..804c09a 100644
--- a/threads.js
+++ b/threads.js
@@ -1308,12 +1308,12 @@ Process.prototype.sendPeerMessage = function (message, peer) {
});
return;
}
- if (peer == stage.peer.id) {
+ if (peer == ide.peer.id) {
stage.newPeerMessage(message, peer);
return;
}
- var connection = stage.peer.connect(peer, {reliable: true});
+ var connection = ide.peer.connect(peer, {reliable: true});
connection.on('open', function () {
var data;
if (typeof message == "string") {
@@ -1331,11 +1331,11 @@ Process.prototype.reportPeerList = function () {
var myself = this;
if (!this.context.wait) {
- var stage = this.homeContext.receiver.parentThatIsA(StageMorph);
- stage.peer.listAllPeers(function (peers) {
+ this.context.wait = true;
+ var ide = this.homeContext.receiver.parentThatIsA(IDE_Morph);
+ ide.peer.listAllPeers(function (peers) {
myself.context.result = new List(peers);
});
- this.context.wait = true;
} else if (this.context.result) {
return this.context.result;
}
@@ -1345,8 +1345,8 @@ Process.prototype.reportPeerList = function () {
};
Process.prototype.reportPeerId = function () {
- var stage = this.homeContext.receiver.parentThatIsA(StageMorph);
- return stage.peer.id;
+ var ide = this.homeContext.receiver.parentThatIsA(IDE_Morph);
+ return ide.peer.id;
};
// Process lists primitives