Skip to content

Commit

Permalink
Merge pull request #6 from algorand/tsachi/properclose
Browse files Browse the repository at this point in the history
flush the connection when writing control messages
  • Loading branch information
tsachiherman authored Oct 22, 2021
2 parents e8779fc + 16dc79e commit 19af735
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,12 @@ func (c *Conn) WriteControl(messageType int, data []byte, deadline time.Time) er
if messageType == CloseMessage {
c.writeFatal(ErrCloseSent)
}
return err

if err != nil {
return err
}

return c.flush()
}

// beginMessage prepares a connection and message writer for a new message.
Expand Down

0 comments on commit 19af735

Please sign in to comment.