diff options
author | Mikio Hara <mikioh.mikioh@gmail.com> | 2014-09-11 17:56:58 +0900 |
---|---|---|
committer | Mikio Hara <mikioh.mikioh@gmail.com> | 2014-09-11 17:56:58 +0900 |
commit | 03a54ed0e6623884cc7db8d36f4a1152b6b56afd (patch) | |
tree | f7bf794afbe0dcce731b026cf16acd15c3280c63 /src/net/tcpsockopt_stub.go | |
parent | c395ef800ee694e3a2ef451010c3f72b0aee4aed (diff) | |
download | go-03a54ed0e6623884cc7db8d36f4a1152b6b56afd.tar.gz |
net: fix inconsistent behavior across platforms in SetKeepAlivePeriod
The previous implementation used per-socket TCP keepalive options
wrong. For example, it used another level socket option to control
TCP and it didn't use TCP_KEEPINTVL option when possible.
Fixes issue 8683.
Fixes issue 8701.
Update issue 8679
LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://codereview.appspot.com/136480043
Diffstat (limited to 'src/net/tcpsockopt_stub.go')
-rw-r--r-- | src/net/tcpsockopt_stub.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/net/tcpsockopt_stub.go b/src/net/tcpsockopt_stub.go new file mode 100644 index 000000000..346293ca4 --- /dev/null +++ b/src/net/tcpsockopt_stub.go @@ -0,0 +1,18 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build nacl openbsd + +package net + +import ( + "syscall" + "time" +) + +func setKeepAlivePeriod(fd *netFD, d time.Duration) error { + // NaCl and OpenBSD have no user-settable per-socket TCP + // keepalive options. + return syscall.ENOPROTOOPT +} |