TOA通讯失败时,关闭连接

This commit is contained in:
GoEdgeLab
2021-06-27 17:31:10 +08:00
parent 9b0f9fe697
commit afbbf729bc

View File

@@ -86,6 +86,7 @@ func (this *TOAManager) SendMsg(msg string) error {
if this.conn != nil {
_, err := this.conn.Write([]byte(msg + "\n"))
if err != nil {
_ = this.conn.Close()
this.conn = nil
}
return err