From ae4826a387e6de58d0625b312851ec0d7526cb26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Thu, 22 Oct 2026 20:46:09 +0800 Subject: [PATCH] Remove command server listen retry --- experimental/libbox/command_server.go | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/experimental/libbox/command_server.go b/experimental/libbox/command_server.go index c727446f..ec0af2ad 100644 --- a/experimental/libbox/command_server.go +++ b/experimental/libbox/command_server.go @@ -2,13 +2,10 @@ package libbox import ( "context" - "errors" "net" "os" "path/filepath" "strconv" - "syscall" - "time" "github.com/sagernet/sing-box/adapter" C "github.com/sagernet/sing-box/constant" @@ -144,19 +141,10 @@ func (s *CommandServer) Start() error { if sCommandServerListenPort == 0 { sockPath := filepath.Join(sBasePath, "command.sock") os.Remove(sockPath) - for range 30 { - listener, err = net.ListenUnix("unix", &net.UnixAddr{ - Name: sockPath, - Net: "unix", - }) - if err == nil { - break - } - if !errors.Is(err, syscall.EROFS) { - break - } - time.Sleep(time.Second) - } + listener, err = net.ListenUnix("unix", &net.UnixAddr{ + Name: sockPath, + Net: "unix", + }) if err != nil { return E.Cause(err, "listen command server") }