I have a cross-platform Golang application which listens on a Unix file socket as follows:
listener, err := net.Listen("unix", socketFilePath)
if err != nil {
return err
}
When this code runs in Windows (Win10 22H2, specifically), it sometimes fails because another process is already listening on that socket:
listen unix [my socket path]: bind: Only one usage of each socket address
(protocol/network address/port) is normally permitted.
How do I find which process already is already bound to the socket? I've already verified that no instances of my application's process are running.
My searching led me to various things about open file handles and open network sockets, but AFAICT Windows treats file sockets differently than either of those, so those tools and techniques don't reveal the thing I'm looking for.
Things that didn't solve my problem: