Skip to content

Commit

Permalink
Merge pull request #1971 from dedis/work-be1-stuart-fix-ws-writer
Browse files Browse the repository at this point in the history
[BE1] Fix ws writer so it doesn't send stream to scala
  • Loading branch information
sgueissa authored Jun 30, 2024
2 parents 0d0e614 + 1593100 commit 239d7b5
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions be1-go/internal/network/socket/socket_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 239d7b5

Please sign in to comment.