github.com/a4a881d4/docker@v1.9.0-rc2/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 11 // NewServer sets up the required Server and does protocol specific checking. 12 func (s *Server) newServer(proto, addr string) ([]*HTTPServer, error) { 13 var ( 14 ls []net.Listener 15 ) 16 switch proto { 17 case "tcp": 18 l, err := s.initTCPSocket(addr) 19 if err != nil { 20 return nil, err 21 } 22 ls = append(ls, l) 23 24 default: 25 return nil, errors.New("Invalid protocol format. Windows only supports tcp.") 26 } 27 28 var res []*HTTPServer 29 for _, l := range ls { 30 res = append(res, &HTTPServer{ 31 &http.Server{ 32 Addr: addr, 33 }, 34 l, 35 }) 36 } 37 return res, nil 38 39 } 40 41 func allocateDaemonPort(addr string) error { 42 return nil 43 }