switch to sending temp/humidity every cb
This commit is contained in:
parent
3f54203246
commit
af4b86b966
2 changed files with 58 additions and 83 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"io"
|
||||
"log/slog"
|
||||
"net"
|
||||
"os"
|
||||
|
|
@ -49,7 +50,11 @@ func handleConnection(conn *net.TCPConn) {
|
|||
//Read up to 1024 bytes
|
||||
n, err := conn.Read(buffer)
|
||||
if err != nil {
|
||||
slog.Error("Error reading from connection", "error", err)
|
||||
if err == io.EOF {
|
||||
slog.Info("Connection closed by client", "remote_addr", conn.RemoteAddr().String())
|
||||
} else {
|
||||
slog.Error("Error reading from connection", "error", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
if n == 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue