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