There was an error while loading. Please reload this page.
2 parents 5a2cd3e + 26b2eb4 commit 8f54846Copy full SHA for 8f54846
ebook/08.1.md
@@ -229,7 +229,8 @@ Go语言中通过net包中的`DialTCP`函数来建立一个TCP连接,并返回
229
### 控制TCP连接
230
TCP有很多连接控制函数,我们平常用到比较多的有如下几个函数:
231
232
-func (c *TCPConn) SetTimeout(nsec int64) os.Error
+#func (c *TCPConn) SetTimeout(nsec int64) os.Error
233
+func DialTimeout(net, addr string, timeout time.Duration) (Conn, error)
234
func (c *TCPConn) SetKeepAlive(keepalive bool) os.Error
235
236
第一个函数用来设置连接的超时时间,客户端和服务器端都适用,当超过设置的时间时该连接就会失效。
0 commit comments