func (c *ConnReq) State() ConnState {
	c.stateMtx.RLock()
	state := c.state
	c.stateMtx.RUnlock()
	return state
}
State is the connection state of the requested connection.
package connmgr
import (
	"errors"
	"fmt"
	"net"
	"sync"
	"sync/atomic"
	"time"
)
const maxFailedAttempts = 25
var (
	ErrDialNil = errors.New("Config: Dial cannot be nil")
	maxRetryDuration = time.Minute * 5
	defaultRetryDuration = time.Second * 5
	defaultTargetOutbound = uint32(8)
)
type ConnState uint8
const (
	ConnPending ConnState = iota
	ConnEstablished
	ConnDisconnected
	ConnFailed
)
type ConnReq struct {
	id uint64
	Addr      net.Addr
	Permanent bool
	conn       net.Conn
	state      ConnState
	stateMtx   sync.RWMutex
	retryCount uint32
}
func (c *ConnReq) updateState(state ConnState) {
	c.stateMtx.Lock()
	c.state = state
	c.stateMtx.Unlock()
}
func (c *ConnReq) ID() uint64 {
	return atomic.LoadUint64(&c.id)
}