File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 23
23
func (b * BufferflowTimed ) Init () {
24
24
log .Println ("Initting timed buffer flow (output once every 16ms)" )
25
25
bufferedOutput = ""
26
+ port = ""
26
27
27
28
go func () {
28
29
b .ticker = time .NewTicker (16 * time .Millisecond )
@@ -32,14 +33,16 @@ func (b *BufferflowTimed) Init() {
32
33
select {
33
34
case data := <- b .Input :
34
35
bufferedOutput = bufferedOutput + data
36
+ port = b .Port
35
37
case <- b .ticker .C :
36
38
if bufferedOutput != "" {
37
- m := SpPortMessage {b . Port , bufferedOutput }
39
+ m := SpPortMessage {port , bufferedOutput }
38
40
buf , _ := json .Marshal (m )
39
41
// data is now encoded in base64 format
40
42
// need a decoder on the other side
41
43
b .Output <- []byte (buf )
42
44
bufferedOutput = ""
45
+ port = ""
43
46
}
44
47
case <- b .done :
45
48
break Loop
You can’t perform that action at this time.
0 commit comments