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?
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?I thinks that's just for local debugging to print the received message on the std out