mirror of
https://github.com/ehang-io/nps.git
synced 2025-10-18 19:23:53 +00:00
bug repair when high concurrent
This commit is contained in:
@@ -12,6 +12,11 @@ import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
type Service interface {
|
||||
Start() error
|
||||
Close() error
|
||||
}
|
||||
|
||||
//server base struct
|
||||
type server struct {
|
||||
id int
|
||||
|
@@ -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) {
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user