Skip to content

Commit 163292f

Browse files
committed
[2.101417.134] 10/14/17 at 01:26 PM | by DashBot
1 parent 9bcd222 commit 163292f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cluster/protocols/cluster-cluster.tcl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,20 @@ if { [info commands ::cluster::protocol::c] eq {} } {
1313
}
1414

1515
::oo::define ::cluster::protocol::c {
16-
variable SOCKET PORT CLUSTER ID CONFIG
16+
variable SOCKET PORT CLUSTER ID CONFIG STREAM
1717
}
1818

1919
::oo::define ::cluster::protocol::c constructor { cluster id config } {
2020
set ID $id
2121
set CONFIG $config
2222
set CLUSTER $cluster
23+
set STREAM [bpacket stream new]
2324
my CreateServer
2425
}
2526

2627
::oo::define ::cluster::protocol::c destructor {
2728
catch { chan close $SOCKET }
29+
catch { $STREAM destroy }
2830
}
2931

3032
::oo::define ::cluster::protocol::c method proto {} { return c }
@@ -127,9 +129,10 @@ if { [info commands ::cluster::protocol::c] eq {} } {
127129
::oo::define ::cluster::protocol::c method Receive {} {
128130
if { [chan eof $SOCKET] } {
129131
catch { chan close $SOCKET }
130-
after 0 [namespace code [list my CreateServer]]
132+
after 0 [list catch [list [namespace code [list my CreateServer]]]]
131133
return
132134
}
133-
set packet [read $SOCKET]
135+
set bytes [read $SOCKET]
136+
134137
$CLUSTER receive [my proto] $SOCKET $packet
135138
}

0 commit comments

Comments
 (0)