完善客户端与服务端注册,端口分配和协议交互逻辑
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Id *int32
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
@@ -22,6 +23,8 @@ type Service struct {
|
||||
ctrlConnWg utils.CountWaitGroup
|
||||
dataConnWg utils.CountWaitGroup
|
||||
userConnWg utils.CountWaitGroup
|
||||
|
||||
fwdPortMap map[uint16]int32 // 转发端口映射,key 为端口号,value 为边缘节点 ID
|
||||
}
|
||||
|
||||
func New(config *Config) *Service {
|
||||
@@ -31,9 +34,10 @@ func New(config *Config) *Service {
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
return &Service{
|
||||
Config: config,
|
||||
ctx: ctx,
|
||||
cancel: cancel,
|
||||
Config: config,
|
||||
ctx: ctx,
|
||||
cancel: cancel,
|
||||
fwdPortMap: make(map[uint16]int32),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user