DialTimeout在net库中已经没了
This commit is contained in:
@@ -229,7 +229,8 @@ Go语言中通过net包中的`DialTCP`函数来建立一个TCP连接,并返回
|
||||
### 控制TCP连接
|
||||
TCP有很多连接控制函数,我们平常用到比较多的有如下几个函数:
|
||||
|
||||
func (c *TCPConn) SetTimeout(nsec int64) os.Error
|
||||
#func (c *TCPConn) SetTimeout(nsec int64) os.Error
|
||||
func DialTimeout(net, addr string, timeout time.Duration) (Conn, error)
|
||||
func (c *TCPConn) SetKeepAlive(keepalive bool) os.Error
|
||||
|
||||
第一个函数用来设置连接的超时时间,客户端和服务器端都适用,当超过设置的时间时该连接就会失效。
|
||||
|
||||
Reference in New Issue
Block a user