diff options
| author | David du Colombier <0intro@gmail.com> | 2015-07-02 08:36:45 +0200 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2015-07-15 02:53:34 +0000 |
| commit | e6a0c21e7d1970431c4b0e82acc9b0ec34dee29f (patch) | |
| tree | 25066356ca14325622e3a159ac03050e1a261f33 /src/net/tcpsockopt_plan9.go | |
| parent | df9423f4dcd7c5f6804f22daa37edf40fdc55d21 (diff) | |
| download | go-git-e6a0c21e7d1970431c4b0e82acc9b0ec34dee29f.tar.gz | |
net: fix setKeepAlivePeriod on Plan 9
The interface to set TCP keepalive on Plan 9 is
writing the "keepalive n" string to the TCP ctl file,
where n is the milliseconds between keepalives.
Fixes #11266.
Change-Id: Ic96f6c584063665a1ddf921a9a4ddfa13cc7501b
Reviewed-on: https://go-review.googlesource.com/11860
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/net/tcpsockopt_plan9.go')
| -rw-r--r-- | src/net/tcpsockopt_plan9.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net/tcpsockopt_plan9.go b/src/net/tcpsockopt_plan9.go index 0e7a6647ca..9abe186cec 100644 --- a/src/net/tcpsockopt_plan9.go +++ b/src/net/tcpsockopt_plan9.go @@ -7,12 +7,13 @@ package net import ( + "strconv" "time" ) // Set keep alive period. func setKeepAlivePeriod(fd *netFD, d time.Duration) error { - cmd := "keepalive " + string(int64(d/time.Millisecond)) + cmd := "keepalive " + strconv.Itoa(int(d/time.Millisecond)) _, e := fd.ctl.WriteAt([]byte(cmd), 0) return e } |
