package server

import (
	"log"

	"github.com/gorilla/websocket"
)

func (server *Server) writeMessages(conn *websocket.Conn) {
	for {
		err := conn.WriteMessage(websocket.TextMessage, []byte("keep alive - staying alive"))
		if err != nil {
			log.Println("Error writing message:", err)
			break
		}
		// This sets the time-out for any outgoing messages.
		// conn.SetWriteDeadline(time.Now().Add(10 * time.Second))
	}
}
