func (conn *Conn) AddLink(id string) {
	logging.Info("add link %s from %d", id, conn.Idx)
	conn.Lock()
	if _, ok := conn.read[id]; !ok {
		conn.read[id] = make(chan *network.Msg)
	}
	conn.Unlock()
}
AddLink attach read message
package pool
import (
	"context"
	"natpass/code/network"
	"natpass/code/utils"
	"strings"
	"sync"
	"time"
	"github.com/lwch/logging"
)
type Conn struct {
	sync.RWMutex
	Idx          uint32
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	parent       *Pool
	conn         *network.Conn
	read         map[string]chan *network.Msg  
	unknownRead  chan *network.Msg             
	write        chan *network.Msg             
}
func newConn(parent *Pool, conn *network.Conn, idx uint32) *Conn {
	ret := &Conn{
		Idx:          idx,
		ReadTimeout:  parent.cfg.ReadTimeout,
		WriteTimeout: parent.cfg.WriteTimeout,
		parent:       parent,
		conn:         conn,
		read:         make(map[string]chan *network.Msg),
		unknownRead:  make(chan *network.Msg),
		write:        make(chan *network.Msg),
	}
	logging.Info("new connection: %s-%d", ret.parent.cfg.ID, ret.Idx)
	ctx, cancel := context.WithCancel(context.Background())
	go ret.loopRead(cancel)
	go ret.loopWrite(cancel)
	go ret.keepalive(ctx)
	return ret
}
func (conn *Conn) hasLink(id string) bool {
	conn.RLock()
	defer conn.RUnlock()
	_, ok := conn.read[id]
	return ok
}