bug repair when high concurrent

This commit is contained in:
刘河
2019-02-18 01:05:05 +08:00
parent 48c7309973
commit dab51c32a2
14 changed files with 229 additions and 242 deletions
+5
View File
@@ -12,6 +12,11 @@ import (
"sync"
)
type Service interface {
Start() error
Close() error
}
//server base struct
type server struct {
id int
+2 -1
View File
@@ -89,8 +89,9 @@ func (s *httpServer) Start() error {
return nil
}
func (s *httpServer) Close() {
func (s *httpServer) Close() error {
s.stop <- true
return nil
}
func (s *httpServer) handleTunneling(w http.ResponseWriter, r *http.Request) {
+4
View File
@@ -87,6 +87,10 @@ func (s *WebServer) Start() error {
return errors.New("Web management startup failure")
}
func (s *WebServer) Close() error {
return nil
}
//new
func NewWebServer(bridge *bridge.Bridge) *WebServer {
s := new(WebServer)