Signed-off-by: arraykeys@gmail.com <arraykeys@gmail.com>

This commit is contained in:
arraykeys@gmail.com
2018-03-16 16:16:11 +08:00
parent 7f983152b7
commit d4c0775b4a
2 changed files with 3 additions and 3 deletions

View File

@ -128,6 +128,9 @@ func (s *MuxBridge) handler(inConn net.Conn) {
}
_group, _ := s.clientControlConns.Get(groupKey)
group := _group.(*utils.ConcurrentMap)
if v, ok := group.Get(index); ok {
v.(*smux.Session).Close()
}
group.Set(index, session)
// s.clientControlConns.Set(key, session)
go func() {

View File

@ -164,7 +164,6 @@ func (s *MuxServer) Start(args interface{}) (err error) {
log.Printf("connection handler crashed with err : %s \nstack: %s", err, string(debug.Stack()))
}
}()
inConnRemoteAddr := inConn.RemoteAddr().String()
var outConn net.Conn
var ID string
for {
@ -178,8 +177,6 @@ func (s *MuxServer) Start(args interface{}) (err error) {
break
}
}
outConnRemoteAddr := outConn.RemoteAddr().String()
log.Printf("%s stream %s created", *s.cfg.Key, ID)
if *s.cfg.IsCompress {
die1 := make(chan bool, 1)