Merge commit '26b2eb4' into _ja

This commit is contained in:
Shin Kojima
2013-12-25 00:33:58 +09:00

View File

@@ -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
第一个函数用来设置连接的超时时间,客户端和服务器端都适用,当超过设置的时间时该连接就会失效。