fix: readPump and writePump hotfix
This commit is contained in:
@@ -70,9 +70,9 @@ func (b *SafeWebsocketServerBuilder) HandleFuncWebsocket(
|
||||
}
|
||||
c := internal.NewClient(conn, subscribedPath)
|
||||
h.Register <- c
|
||||
internal.WritePump(c, h)
|
||||
internal.ReadPump(c)
|
||||
writeFunc(h.Broadcast)
|
||||
go internal.WritePump(c, h)
|
||||
go internal.ReadPump(c, h)
|
||||
go writeFunc(h.Broadcast)
|
||||
})
|
||||
return b
|
||||
}
|
||||
@@ -85,7 +85,6 @@ func (b *SafeWebsocketServerBuilder) Build() (*SafeWebsocketServer, error) {
|
||||
safeServer := SafeWebsocketServer{
|
||||
url: fmt.Sprintf("%s:%d", *b.baseHost, *b.basePort),
|
||||
mux: b.mux,
|
||||
mu: internal.NewCustomRwMutex(),
|
||||
}
|
||||
return &safeServer, nil
|
||||
}
|
||||
@@ -94,7 +93,6 @@ type SafeWebsocketServer struct {
|
||||
hub *internal.Hub
|
||||
mux *http.ServeMux
|
||||
url string
|
||||
mu *internal.CustomRwMutex
|
||||
}
|
||||
|
||||
func (s *SafeWebsocketServer) ListenAndServe() error {
|
||||
|
||||
Reference in New Issue
Block a user