feat!: remove TCP socket support for server connections (#2527)

Windows has supported Unix domain sockets for quite some time now, so falling back to TCP sockets can be removed. As a result, Unix domain sockets will be used on all platforms.
This commit is contained in:
valoq authored and GitHub committed 2026-04-16 11:37:30 +10:00
1 parent 66bc58b4bf
commit 867cd99f50
5 files changed
+13 -33

No files matched your search

+6 -14
View File
@@ -35,7 +35,6 @@ var (
gHostname string
gLastDirPath string
gSelectionPath string
gSocketProt string
gSocketPath string
gLogPath string
gSelect string
@@ -178,19 +177,13 @@ func startServer() {
}
func checkServer() {
if gSocketProt == "unix" {
if _, err := os.Stat(gSocketPath); os.IsNotExist(err) {
startServer()
} else if _, err := net.Dial(gSocketProt, gSocketPath); err != nil {
if err := os.Remove(gSocketPath); err != nil {
log.Print(err)
}
startServer()
}
} else {
if _, err := net.Dial(gSocketProt, gSocketPath); err != nil {
startServer()
if _, err := os.Stat(gSocketPath); os.IsNotExist(err) {
startServer()
} else if _, err := net.Dial("unix", gSocketPath); err != nil {
if err := os.Remove(gSocketPath); err != nil {
log.Print(err)
}
startServer()
}
}
@@ -316,7 +309,6 @@ Options:
flag.Parse()
gSocketProt = gDefaultSocketProt
gSocketPath = gDefaultSocketPath
if gLogPath != "" {