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") }