Skip to content

Commit

Permalink
Trap use of closed connection error when closing response listener go…
Browse files Browse the repository at this point in the history
…routine
  • Loading branch information
Steve Merrony committed Jul 22, 2018
1 parent 30f2bb4 commit fa63343
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tello.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"log"
"net"
"strconv"
"strings"
"sync"
"time"
)
Expand Down Expand Up @@ -291,6 +292,9 @@ func (tello *Tello) controlResponseListener() {
default:
}
if err != nil {
if strings.HasSuffix(err.Error(), "use of closed network connection") {
return
}
log.Printf("Network Read Error - %v\n", err)
} else {
if buff[0] != msgHdr {
Expand Down

0 comments on commit fa63343

Please sign in to comment.