On Tue, Jun 11, 2013 at 10:34 AM, <
kyle.a...@gmail.com> wrote:
> I want to be able to run two separate http servers concurrently on different
> port numbers. http.ListenAndServe already puts the script into a never
> ending state, but if I start two separate go routines, the script will
> immediately exit. I've also tried only calling one as a go routine but I get
> an error of 'multiple registrations'
An example of your code would help us help you.
The 'multiple registrations' error is the result of adding multiple
handlers for the same url to a servemux.
http://golang.org/src/pkg/net/http/server.go?#L1432
http.ListenAndServe() expects an address to listen on and a
http.Handler to handle the incoming requests.
"Handler is typically nil, in which case the DefaultServeMux is used."
If you're starting two http.ListenAndServe() and they both have a nil
Handler than you're sharing the DefaultServeMux between
them and routes added to one will be available on the other.
--
=====================
http://jessta.id.au