增加重连
This commit is contained in:
parent
322a051f32
commit
92ebac31b9
|
@ -112,11 +112,11 @@ func (t *TcpHelper) Close(conn net.Conn) {
|
|||
}
|
||||
func (t *TcpHelper) watch(conn net.Conn) {
|
||||
go func() {
|
||||
//defer func() {
|
||||
// if err := recover(); err != nil {
|
||||
// fmt.Println("连接断开", err)
|
||||
// }
|
||||
//}()
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
fmt.Println("连接断开", err)
|
||||
}
|
||||
}()
|
||||
for {
|
||||
conn.SetWriteDeadline(time.Now().Add(expire))
|
||||
_, err := conn.Write([]byte("1\n"))
|
||||
|
|
Loading…
Reference in New Issue