File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments