Functions. I understand the need for the messageHandler() function because that will be the function that gets executed inside the echo() function when a new websocket connection is created, but the server.WriteMessage() on a for loop I don't understand the point behind it?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello,
I don't understand why do you have both the:
for {server.WriteMessage([]byte("Hello"))
}
And:
func messageHandler(message []byte) {fmt.Println(string(message))
}
Functions. I understand the need for the messageHandler() function because that will be the function that gets executed inside the echo() function when a new websocket connection is created, but the
server.WriteMessage()on a for loop I don't understand the point behind it?