github.com/rentongzhang/docker@v1.8.2-rc1/api/server/server_windows.go (about) 1 // +build windows 2 3 package server 4 5 import ( 6 "errors" 7 "net" 8 "net/http" 9 10 "github.com/docker/docker/daemon" 11 "github.com/docker/docker/pkg/version" 12 "github.com/docker/docker/runconfig" 13 ) 14 15 // NewServer sets up the required Server and does protocol specific checking. 16 func (s *Server) newServer(proto, addr string) ([]serverCloser, error) { 17 var ( 18 ls []net.Listener 19 ) 20 switch proto { 21 case "tcp": 22 l, err := s.initTcpSocket(addr) 23 if err != nil { 24 return nil, err 25 } 26 ls = append(ls, l) 27 28 default: 29 return nil, errors.New("Invalid protocol format. Windows only supports tcp.") 30 } 31 32 var res []serverCloser 33 for _, l := range ls { 34 res = append(res, &HttpServer{ 35 &http.Server{ 36 Addr: addr, 37 Handler: s.router, 38 }, 39 l, 40 }) 41 } 42 return res, nil 43 44 } 45 46 func (s *Server) AcceptConnections(d *daemon.Daemon) { 47 s.daemon = d 48 s.registerSubRouter() 49 // close the lock so the listeners start accepting connections 50 select { 51 case <-s.start: 52 default: 53 close(s.start) 54 } 55 } 56 57 func allocateDaemonPort(addr string) error { 58 return nil 59 } 60 61 func adjustCpuShares(version version.Version, hostConfig *runconfig.HostConfig) { 62 }