tcpsockopt_plan9.go 525 B

123456789101112131415161718192021222324
  1. // Copyright 2014 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // TCP socket options for plan9
  5. package net
  6. import (
  7. "internal/itoa"
  8. "syscall"
  9. "time"
  10. )
  11. func setNoDelay(fd *netFD, noDelay bool) error {
  12. return syscall.EPLAN9
  13. }
  14. // Set keep alive period.
  15. func setKeepAlivePeriod(fd *netFD, d time.Duration) error {
  16. cmd := "keepalive " + itoa.Itoa(int(d/time.Millisecond))
  17. _, e := fd.ctl.WriteAt([]byte(cmd), 0)
  18. return e
  19. }