Skip to content

Commit

Permalink
Stop recieve spinning if USB stick disappears, helps but does not sol…
Browse files Browse the repository at this point in the history
…ve #25.
  • Loading branch information
pwood committed Jul 14, 2024
1 parent 5284f96 commit 115f7e5
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions broker/receiving.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package broker

import (
"errors"
"io"
"log"
"syscall"
)
Expand All @@ -12,18 +11,12 @@ func (b *Broker) handleReceiving() {
frame, err := b.FrameReader(b.reader)

if err != nil {
switch e := err.(type) {
case syscall.Errno:
if e == syscall.EINTR {
continue
}
if errors.Is(err, syscall.EINTR) {
continue
}

log.Printf("unpi read failed: %v\n", err)

if errors.Is(err, io.EOF) {
return
}
return
} else {
b.handleListeners(frame)
}
Expand Down

0 comments on commit 115f7e5

Please sign in to comment.