I had this happen at work. The golang server will be listening to the IPv6 port 80 while the other application is only listening to IPv4.
For me the golang app was running first. And it stop listening to v4 and then resumed once the other app was closed.
[edit later]
To demostrate this, I just ran the WinSock bind/listen C++ code found on this MSDN page with the port changed to 80, then I used this Go code:
package main
import (
"log"
"net/http"
)
func main() {
http.Handle("/", http.FileServer(http.Dir("c:\\temp")))
log.Fatal(http.ListenAndServe(":80", nil))
}
This setup worked because the C++ was listening to 127.0.0.1
and the Go on 0.0.0.0
Changing the go code to log.Fatal(http.ListenAndServe("127.0.0.1:80", nil))
caused the error message nemo suggested.
I then started my main production code, which has a Mongoose HTTP instance, and it's listening on 0.0.0.0:80
, and then ran the above Go code (removing 127.0.0.1) and both are listening to 0.0.0.0:80
, this can be seen via Process Explorer.