crossdock/client/client.go
func (c *Client) listen() error {
	c.setDefaultPort(&c.ClientHostPort, ":"+common.DefaultClientPortHTTP)
	c.setDefaultPort(&c.ServerPort, common.DefaultServerPort)

	c.mux = http.NewServeMux() // Using default mux creates problem in unit tests
	c.mux.Handle("/", crossdock.Handler(c.Behaviors, true))

	listener, err := net.Listen("tcp", c.ClientHostPort)
	if err != nil {
		return err
	}
	c.listener = listener
	c.ClientHostPort = listener.Addr().String() // override in case it was ":0"
	return nil
}
func (c *Client) listen() error {
	c.setDefaultPort(&c.ClientHostPort, ":"+common.DefaultClientPortHTTP)
	c.setDefaultPort(&c.ServerPort, common.DefaultServerPort)

	c.mux = http.NewServeMux() // Using default mux creates problem in unit tests
	c.mux.Handle("/", crossdock.Handler(c.Behaviors, true))

	listener, err := net.Listen("tcp", c.ClientHostPort)
	if err != nil {
		return err
	}
	c.listener = listener
	c.ClientHostPort = listener.Addr().String() // override in case it was ":0"
	return nil
}
// Listen initializes the server