package server

import (
	"log"

	"github.com/gorilla/websocket"
)

func (server *Server) writeMessage(agent Agent, message string) {
	for {
		err := agent.conn.WriteMessage(websocket.TextMessage, []byte(message))
		if err != nil {
			log.Println("Error writing message:", err)
			break
		}
	}
}
