Merge pull request #3 from aginetwork7/fix/xtcp-session-close

Fix/xtcp session close
This commit is contained in:
dashuang 2024-04-12 10:24:23 +08:00 committed by GitHub
commit 7dca8627a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -151,7 +151,7 @@ func (pxy *XTCPProxy) listenByKCP(listenConn *net.UDPConn, raddr *net.UDPAddr, s
defer session.Close()
for {
muxConn, err := session.Accept()
muxConn, err := session.AcceptStreamWithContext(pxy.ctx)
if err != nil {
xl.Errorf("accept connection error: %v", err)
return

View File

@ -519,7 +519,7 @@ func (svr *Service) HandleListener(l net.Listener, internal bool) {
}
for {
stream, err := session.AcceptStream()
stream, err := session.AcceptStreamWithContext(ctx)
if err != nil {
log.Debugf("Accept new mux stream error: %v", err)
session.Close()