Improve connection timeout

This commit is contained in:
世界
2022-07-18 20:40:14 +08:00
parent 3fb011712b
commit c7fabe40ed
14 changed files with 152 additions and 111 deletions

5
box.go
View File

@@ -143,9 +143,12 @@ func (s *Box) Start() error {
if err != nil {
return err
}
for _, in := range s.inbounds {
for i, in := range s.inbounds {
err = in.Start()
if err != nil {
for g := 0; g < i; g++ {
s.inbounds[g].Close()
}
return err
}
}