From 1593100d4299d3b6fe1108de33d948230609a208 Mon Sep 17 00:00:00 2001 From: stuart Date: Sun, 30 Jun 2024 15:57:35 +0200 Subject: [PATCH] Fix ws writer so it doesn't send stream to scala --- be1-go/internal/network/socket/socket_impl.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/be1-go/internal/network/socket/socket_impl.go b/be1-go/internal/network/socket/socket_impl.go index de101b5723..a081cc9247 100644 --- a/be1-go/internal/network/socket/socket_impl.go +++ b/be1-go/internal/network/socket/socket_impl.go @@ -127,19 +127,13 @@ func (s *baseSocket) WritePump() { return } - w, err := s.conn.NextWriter(websocket.TextMessage) + err := s.conn.WriteMessage(websocket.TextMessage, message) if err != nil { - s.log.Err(err).Msg("failed to retrieve writer") + s.log.Error().Err(err).Send() return } - w.Write(message) s.log.Info().RawJSON("sent", message).Msg("") - - if err := w.Close(); err != nil { - s.log.Err(err).Msg("failed to close writer") - return - } case <-ticker.C: s.conn.SetWriteDeadline(time.Now().Add(writeWait)) if err := s.conn.WriteMessage(websocket.PingMessage, nil); err != nil {