github.com/TeaOSLab/EdgeNode@v1.3.8/internal/nodes/client_conn_utils.go (about)

     1  // Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
     2  
     3  package nodes
     4  
     5  import (
     6  	"net"
     7  )
     8  
     9  // 判断客户端连接是否已关闭
    10  func isClientConnClosed(conn net.Conn) bool {
    11  	if conn == nil {
    12  		return true
    13  	}
    14  	clientConn, ok := conn.(ClientConnInterface)
    15  	if ok {
    16  		return clientConn.IsClosed()
    17  	}
    18  
    19  	return true
    20  }