2016-07-22 20:15:38 +02:00
|
|
|
// Copyright 2014 The Go Authors. All rights reserved.
|
2014-06-07 00:37:27 +02:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// TCP socket options for plan9
|
|
|
|
|
|
|
|
package net
|
|
|
|
|
|
|
|
import (
|
2021-07-30 23:28:58 +02:00
|
|
|
"internal/itoa"
|
2016-07-22 20:15:38 +02:00
|
|
|
"syscall"
|
2014-06-07 00:37:27 +02:00
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2016-07-22 20:15:38 +02:00
|
|
|
func setNoDelay(fd *netFD, noDelay bool) error {
|
|
|
|
return syscall.EPLAN9
|
|
|
|
}
|
|
|
|
|
2014-06-07 00:37:27 +02:00
|
|
|
// Set keep alive period.
|
|
|
|
func setKeepAlivePeriod(fd *netFD, d time.Duration) error {
|
2021-07-30 23:28:58 +02:00
|
|
|
cmd := "keepalive " + itoa.Itoa(int(d/time.Millisecond))
|
2014-06-07 00:37:27 +02:00
|
|
|
_, e := fd.ctl.WriteAt([]byte(cmd), 0)
|
|
|
|
return e
|
|
|
|
}
|