Skip to content

Commit

Permalink
Anders GIDENSTAM: fix problem caused by last Nasal update ... or some…
Browse files Browse the repository at this point in the history
…thing
  • Loading branch information
mfranz committed Oct 14, 2008
1 parent fcea5ed commit 4aed2f2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Models/mp_broadcast.nas
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,19 @@
var BroadcastChannel = {};
BroadcastChannel.new = func (mpp_path, process,
send_to_self = 0,
accept_predicate = func (p) { return 1; },
on_disconnect = func (p) { return; },
accept_predicate = nil,
on_disconnect = nil,
enable_send=1) {
obj = { parents : [BroadcastChannel],
mpp_path : mpp_path,
send_node : enable_send ? props.globals.getNode(mpp_path, 1)
: nil,
process_msg : process,
send_to_self : send_to_self,
accept_predicate : accept_predicate,
on_disconnect : on_disconnect,
accept_predicate : (accept_predicate != nil) ? accept_predicate :
func (p) { return 1; },
on_disconnect : (on_disconnect != nil) ? on_disconnect :
func (p) { return; },
# Internal state.
send_buf : [],
peers : {},
Expand All @@ -67,10 +69,11 @@ BroadcastChannel.new = func (mpp_path, process,
print("]");
}
settimer(func { obj._loop_(obj.loopid); }, 0, 1);
if (enable_send)
if (enable_send) {
print("BroadcastChannel[" ~ obj.mpp_path ~ "] ... started.");
else
} else {
print("ReceiveBroadcastChannel[" ~ obj.mpp_path ~ "] ... started.");
}
return obj;
}
BroadcastChannel.send = func (msg) {
Expand Down

0 comments on commit 4aed2f2

Please sign in to comment.