For example, sending the status code with SendStatus()
after you’ve already sent content
with SendMessage()
is not allowed.
import "github.com/razshare/frizzante/connections"
func Welcome(connection *connections.Connection) {
connection.SendMessage("Hello.") // Sends text (Succeeds).
connection.SendStatus(404) // Sends status (Fails).
connections.SendStatus(404)
will fail and the user will receive status 200
instead of 404
.
Date: Sun, 25 May 2025 02:00:37 GMT
Content-Type: text/plain; charset=utf-8
The failure is notified to the server notifier.
Assuming you’re using the default notifier, you’ll see an error of sorts in your console
listening for requests at http://127.0.0.1:8080
status is locked
, meaning the status code has already been sent to the client and there’s nothing you can do about it.