mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
da5a3e6dee
This commit also brings in the ability to specify a default network and its corresponding driver as daemon flags. This helps in existing clients to make use of newer networking features provided by libnetwork. Signed-off-by: Madhu Venugopal <madhu@docker.com>
62 lines
1.1 KiB
Go
62 lines
1.1 KiB
Go
// +build windows
|
|
|
|
package server
|
|
|
|
import (
|
|
"errors"
|
|
"net"
|
|
"net/http"
|
|
|
|
"github.com/docker/docker/daemon"
|
|
"github.com/docker/docker/pkg/version"
|
|
"github.com/docker/docker/runconfig"
|
|
)
|
|
|
|
// NewServer sets up the required Server and does protocol specific checking.
|
|
func (s *Server) newServer(proto, addr string) ([]serverCloser, error) {
|
|
var (
|
|
ls []net.Listener
|
|
)
|
|
switch proto {
|
|
case "tcp":
|
|
l, err := s.initTcpSocket(addr)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
ls = append(ls, l)
|
|
|
|
default:
|
|
return nil, errors.New("Invalid protocol format. Windows only supports tcp.")
|
|
}
|
|
|
|
var res []serverCloser
|
|
for _, l := range ls {
|
|
res = append(res, &HttpServer{
|
|
&http.Server{
|
|
Addr: addr,
|
|
Handler: s.router,
|
|
},
|
|
l,
|
|
})
|
|
}
|
|
return res, nil
|
|
|
|
}
|
|
|
|
func (s *Server) AcceptConnections(d *daemon.Daemon) {
|
|
s.daemon = d
|
|
s.registerSubRouter()
|
|
// close the lock so the listeners start accepting connections
|
|
select {
|
|
case <-s.start:
|
|
default:
|
|
close(s.start)
|
|
}
|
|
}
|
|
|
|
func allocateDaemonPort(addr string) error {
|
|
return nil
|
|
}
|
|
|
|
func adjustCpuShares(version version.Version, hostConfig *runconfig.HostConfig) {
|
|
}
|