func (manager *backwardManager) newBackward(task *BackwardTask) {
	if _, ok := manager.backwardMap[task.UUID]; !ok {
		manager.backwardMap = make(map[string]map[string]*backward)
		manager.backwardMap[task.UUID] = make(map[string]*backward)
	}
	manager.backwardMap[task.UUID][task.RPort] = new(backward)
	manager.backwardMap[task.UUID][task.RPort].localPort = task.LPort
	manager.backwardMap[task.UUID][task.RPort].backwardStatusMap = make(map[uint64]*backwardStatus)
	manager.ResultChan <- &backwardResult{OK: true}
}
register a brand new backforward
package manager
import (
	"fmt"
	"net"
)
const (
	B_NEWBACKWARD = iota
	B_GETNEWSEQ
	B_ADDCONN
	B_UPDATEBACKWARD
	B_GETDATACHAN
	B_GETDATACHAN_WITHOUTUUID
	B_CLOSETCP
	B_GETBACKWARDINFO
	B_GETSTOPRPORT
	B_CLOSESINGLE
	B_CLOSESINGLEALL
	B_FORCESHUTDOWN
)
type backwardManager struct {
	backwardSeq      uint64
	backwardSeqMap   map[uint64]*bwSeqRelationship    
	backwardMap      map[string]map[string]*backward  
	backwardReadyDel map[int]string
	BackwardMessChan chan interface{}
	BackwardReady    chan bool
	TaskChan   chan *BackwardTask
	ResultChan chan *backwardResult
}
type BackwardTask struct {
	Mode int
	UUID string  
	Seq  uint64  
	LPort  string
	RPort  string
	Conn   net.Conn
	Choice int
}
type backwardResult struct {
	OK bool
	DataChan     chan []byte
	BackwardSeq  uint64
	BackwardInfo []string
	RPort        string
}
type backward struct {
	localPort string
	backwardStatusMap map[uint64]*backwardStatus
}
type backwardStatus struct {
	dataChan chan []byte
	conn     net.Conn
}
type bwSeqRelationship struct {
	uuid  string
	rPort string
}
func newBackwardManager() *backwardManager {
	manager := new(backwardManager)
	manager.backwardMap = make(map[string]map[string]*backward)
	manager.backwardSeqMap = make(map[uint64]*bwSeqRelationship)
	manager.BackwardMessChan = make(chan interface{}, 5)
	manager.BackwardReady = make(chan bool)
	manager.TaskChan = make(chan *BackwardTask)
	manager.ResultChan = make(chan *backwardResult)
	return manager
}
func (manager *backwardManager) run() {
	for {
		task := <-manager.TaskChan
		switch task.Mode {
		case B_NEWBACKWARD:
			manager.newBackward(task)
		case B_GETNEWSEQ:
			manager.getNewSeq(task)
		case B_ADDCONN:
			manager.addConn(task)
		case B_UPDATEBACKWARD:
			manager.updateBackward(task)
		case B_GETDATACHAN:
			manager.getDataChan(task)
		case B_GETDATACHAN_WITHOUTUUID:
			manager.getDatachanWithoutUUID(task)
		case B_CLOSETCP:
			manager.closeTCP(task)
		case B_GETBACKWARDINFO:
			manager.getBackwardInfo(task)
		case B_GETSTOPRPORT:
			manager.getStopRPort(task)
		case B_CLOSESINGLE:
			manager.closeSingle(task)
		case B_CLOSESINGLEALL:
			manager.closeSingleAll(task)
		case B_FORCESHUTDOWN:
			manager.forceShutdown(task)
		}
	}
}