func (s *Socket) listenToMessagesIn() {
	for {
		message := new(Message)
		err := s.connection.ReadJSON(&message)
		if err != nil {
			if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway, websocket.CloseAbnormalClosure) {
				log.Printf("Error: %v", err)
			}
			break
		}
		s.messagesIn <- message
	}
}
// listenToMessagesIn reads incoming messages from the websocket connection
// and sends these messages into the messageIn channel
listenToMessagesIn reads incoming messages from the websocket connection
and sends these messages into the messageIn channel
// listenToMessagesIn reads incoming messages from the websocket connection // and sends these messages into the messageIn channel
func (s *Socket) listenToMessagesIn() {
	for {
		message := new(Message)
		err := s.connection.ReadJSON(&message)
		if err != nil {
			if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway, websocket.CloseAbnormalClosure) {
				log.Printf("Error: %v", err)
			}
			break
		}
		s.messagesIn <- message
	}
}
func ( s * Socket ) listenToMessagesIn ( ) { for { message := new ( Message ) err := s . connection . ReadJSON ( & message ) if err != nil { if websocket . IsUnexpectedCloseError ( err , websocket . CloseGoingAway , websocket . CloseAbnormalClosure ) { log . Printf ( " " , err ) } break } s . messagesIn <- message } }
listenToMessagesIn reads incoming messages from the websocket connection
and sends these messages into the messageIn channel
listenToMessagesIn reads incoming messages from the websocket connection and sends these messages into the messageIn channel