mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-29 01:06:35 +08:00
TCP单次向客户端写入数据时超过30秒即认为超时
This commit is contained in:
@@ -114,6 +114,9 @@ func (this *ClientConn) Read(b []byte) (n int, err error) {
|
||||
}
|
||||
|
||||
func (this *ClientConn) Write(b []byte) (n int, err error) {
|
||||
// 设置超时时间
|
||||
_ = this.rawConn.SetWriteDeadline(time.Now().Add(30 * time.Second)) // TODO 时间可以设置
|
||||
|
||||
n, err = this.rawConn.Write(b)
|
||||
if n > 0 {
|
||||
// 统计当前服务带宽
|
||||
|
||||
Reference in New Issue
Block a user