mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-09 12:00:26 +08:00
TOA通讯失败时,关闭连接
This commit is contained in:
@@ -86,6 +86,7 @@ func (this *TOAManager) SendMsg(msg string) error {
|
|||||||
if this.conn != nil {
|
if this.conn != nil {
|
||||||
_, err := this.conn.Write([]byte(msg + "\n"))
|
_, err := this.conn.Write([]byte(msg + "\n"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
_ = this.conn.Close()
|
||||||
this.conn = nil
|
this.conn = nil
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user