We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 59e009d commit 4fc615aCopy full SHA for 4fc615a
bufferflow_timed.go
@@ -23,6 +23,7 @@ var (
23
func (b *BufferflowTimed) Init() {
24
log.Println("Initting timed buffer flow (output once every 16ms)")
25
bufferedOutput = ""
26
+ port = ""
27
28
go func() {
29
b.ticker = time.NewTicker(16 * time.Millisecond)
@@ -32,14 +33,16 @@ func (b *BufferflowTimed) Init() {
32
33
select {
34
case data := <-b.Input:
35
bufferedOutput = bufferedOutput + data
36
+ port = b.Port
37
case <-b.ticker.C:
38
if bufferedOutput != "" {
- m := SpPortMessage{b.Port, bufferedOutput}
39
+ m := SpPortMessage{port, bufferedOutput}
40
buf, _ := json.Marshal(m)
41
// data is now encoded in base64 format
42
// need a decoder on the other side
43
b.Output <- []byte(buf)
44
45
46
}
47
case <-b.done:
48
break Loop
0 commit comments