// Copyright 2023 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.

//go:build (!windows && !solaris) || illumos

package net

import 

// SetKeepAliveConfig configures keep-alive messages sent by the operating system.
func ( *TCPConn) ( KeepAliveConfig) error {
	if !.ok() {
		return syscall.EINVAL
	}

	if  := setKeepAlive(.fd, .Enable);  != nil {
		return &OpError{Op: "set", Net: .fd.net, Source: .fd.laddr, Addr: .fd.raddr, Err: }
	}
	if  := setKeepAliveIdle(.fd, .Idle);  != nil {
		return &OpError{Op: "set", Net: .fd.net, Source: .fd.laddr, Addr: .fd.raddr, Err: }
	}
	if  := setKeepAliveInterval(.fd, .Interval);  != nil {
		return &OpError{Op: "set", Net: .fd.net, Source: .fd.laddr, Addr: .fd.raddr, Err: }
	}
	if  := setKeepAliveCount(.fd, .Count);  != nil {
		return &OpError{Op: "set", Net: .fd.net, Source: .fd.laddr, Addr: .fd.raddr, Err: }
	}

	return nil
}