Skip to content

Commit 8f54846

Browse files
committed
Merge pull request astaxie#186 from better0332/patch-2
DialTimeout在net库中已经没了
2 parents 5a2cd3e + 26b2eb4 commit 8f54846

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ebook/08.1.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ Go语言中通过net包中的`DialTCP`函数来建立一个TCP连接,并返回
229229
### 控制TCP连接
230230
TCP有很多连接控制函数,我们平常用到比较多的有如下几个函数:
231231

232-
func (c *TCPConn) SetTimeout(nsec int64) os.Error
232+
#func (c *TCPConn) SetTimeout(nsec int64) os.Error
233+
func DialTimeout(net, addr string, timeout time.Duration) (Conn, error)
233234
func (c *TCPConn) SetKeepAlive(keepalive bool) os.Error
234235

235236
第一个函数用来设置连接的超时时间,客户端和服务器端都适用,当超过设置的时间时该连接就会失效。

0 commit comments

Comments
 (0)