小编kon*_*huo的帖子

net.Dialer#KeepAlive 和 http.Transport#IdleTimeout 有什么区别?

type Dialer struct {
    ......
    // KeepAlive specifies the keep-alive period for an active
    // network connection.
    // If zero, keep-alives are enabled if supported by the protocol
    // and operating system. Network protocols or operating systems
    // that do not support keep-alives ignore this field.
    // If negative, keep-alives are disabled.
    KeepAlive time.Duration
}
Run Code Online (Sandbox Code Playgroud)
type Transport struct {
    ......
// IdleConnTimeout is the maximum amount of time an idle
    // (keep-alive) connection will remain idle before closing
    // itself. …
Run Code Online (Sandbox Code Playgroud)

network-programming http go

-2
推荐指数
1
解决办法
1504
查看次数

标签 统计

go ×1

http ×1

network-programming ×1