// Start is used to start a TCP check.
// The check runs until stop is called
Start is used to start a TCP check.
The check runs until stop is called
// Start is used to start a TCP check . // The check runs until stop is called
func (c *CheckTCP) Init(updateCh chan bool, dst types.Destination) {
	c.stopCh = make(chan bool)
	c.updateCh = updateCh
	if c.dialer == nil {
		c.dialer = &net.Dialer{DualStack: true}
		if c.Spec.Timeout > 0 && c.Spec.Timeout < c.Spec.Interval {
			c.dialer.Timeout = c.Spec.Timeout
		} else if c.Spec.Interval < 10*time.Second {
			c.dialer.Timeout = c.Spec.Interval
		}
	}
	c.tcp = fmt.Sprintf("%s:%d", dst.Address, dst.Port)
	logrus.Debugf("[health-check] Init check on %s at %s. Interval=%s Timeout=%s", c.DestinationID, c.tcp, c.Spec.Interval, c.Spec.Timeout)
}
func ( c * CheckTCP ) Init ( updateCh chan bool , dst types . Destination ) { c . stopCh = make ( chan bool ) c . updateCh = updateCh if c . dialer == nil { c . dialer = & net . Dialer { DualStack : true } if c . Spec . Timeout > 0 && c . Spec . Timeout < c . Spec . Interval { c . dialer . Timeout = c . Spec . Timeout } else if c . Spec . Interval < 10 * time . Second { c . dialer . Timeout = c . Spec . Interval } } c . tcp = fmt . Sprintf ( " " , dst . Address , dst . Port ) logrus . Debugf ( " " , c . DestinationID , c . tcp , c . Spec . Interval , c . Spec . Timeout ) }
Start is used to start a TCP check.
Start is used to start a TCP check .
// Create the socket dialer // For long (>10s) interval checks the socket timeout is 10s, otherwise // the timeout is the interval. This means that a check *should* return // before the next check begins.