// Sets the heartbeat timeout.
175989
func (s *server) SetHeartbeatInterval(duration time.Duration) {
	s.mutex.Lock()
	defer s.mutex.Unlock()

	s.heartbeatInterval = duration
	for _, peer := range s.peers {
		peer.setHeartbeatInterval(duration)
	}
}
1195628
func SetTCPUserTimeout(conn net.Conn, timeout time.Duration) error {
	tcpconn, ok := conn.(*net.TCPConn)
	if !ok {
		// not a TCP connection. exit early
		return nil
	}
	rawConn, err := tcpconn.SyscallConn()
	if err != nil {
		return fmt.Errorf("error getting raw connection: %v", err)
	}
	err = rawConn.Control(func(fd uintptr) {
		err = syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, unix.TCP_USER_TIMEOUT, int(timeout/time.Millisecond))
	})
	if err != nil {
		return fmt.Errorf("error setting option on socket: %v", err)
	}

	return nil
}
1080994
func (c *Connection) heartbeater(interval time.Duration, done chan *Error) {
	const maxServerHeartbeatsInFlight = 3

	var sendTicks <-chan time.Time
	if interval > 0 {
		ticker := time.NewTicker(interval)
		defer ticker.Stop()
		sendTicks = ticker.C
	}

	lastSent := time.Now()

	for {
		select {
		case at, stillSending := <-c.sends:
			// When actively sending, depend on sent frames to reset server timer
			if stillSending {
				lastSent = at
			} else {
				return
			}

		case at := <-sendTicks:
			// When idle, fill the space with a heartbeat frame
			if at.Sub(lastSent) > interval-time.Second {
				if err := c.send(&heartbeatFrame{}); err != nil {
					// send heartbeats even after close/closeOk so we
					// tick until the connection starts erroring
					return
				}
			}

		case conn := <-c.deadlines:
			// When reading, reset our side of the deadline, if we've negotiated one with
			// a deadline that covers at least 2 server heartbeats
			if interval > 0 {
				conn.SetReadDeadline(time.Now().Add(maxServerHeartbeatsInFlight * interval))
			}

		case <-done:
			return
		}
	}
}
1336527
func (s *SubmitJobInput) SetTimeout(v *JobTimeout) *SubmitJobInput {
	s.Timeout = v
	return s
}
896788
func (spec *ConnectionSpec) Heartbeat(period time.Duration) *ConnectionSpec {
	spec.heartbeat = period
	return spec
}
618727
func (o *ClientOptions) SetPingTimeout(k time.Duration) *ClientOptions {
	o.PingTimeout = k
	return o
}
711011
func (c *connection) SetIdleTimeout(timeout time.Duration) {
	c.conn.SetIdleTimeout(timeout)
}
126542
func (s *MaintenanceWindowRunCommandParameters) SetTimeoutSeconds(v int64) *MaintenanceWindowRunCommandParameters {
	s.TimeoutSeconds = &v
	return s
}
1194275
func SetLifetime(d time.Duration) Option {
	return func(h *Handler) error {
		h.lifetime = d
		return nil
	}
}
1204070
func (s *Action) SetTimeout(v int64) *Action {
	s.Timeout = &v
	return s
}
516441
func (c *BaseConn) SetReadTimeout(timeout time.Duration) {
	c.readTimeout = timeout

	// apply new timeout immediately
	_ = c.resetTimeout()
}
101225
func SetTCPUserTimeout(conn net.Conn, timeout time.Duration) error {
	log()
	return nil
}
966299
func (c *Client) SetTimeout(t time.Duration) {
	if c.HTTPClient != nil {
		c.HTTPClient.Timeout = t
	}
}
1359715
func (p *PodHealthCheck) SetInterval(intervalSeconds int) *PodHealthCheck {
	p.IntervalSeconds = &intervalSeconds
	return p
}
1052358
func (rc *ReadinessCheck) SetTimeout(timeout time.Duration) *ReadinessCheck {
	secs := int(timeout.Seconds())
	rc.TimeoutSeconds = secs
	return rc
}
604699
func (c *Client) SetTimeout(timeout int) {
	c.client.Timeout = time.Duration(timeout) * time.Millisecond
}
660971
func (s *GameSessionQueue) SetTimeoutInSeconds(v int64) *GameSessionQueue {
	s.TimeoutInSeconds = &v
	return s
}