Golang websocket was truncated while reading information

use x.net.websocket to read information, there is a lot of data, and it is found that it cannot be read completely at one time. Always returns a length of 4092,


func receiveWebsocket(ws *websocket.Conn) error {
    for {
        var msg = make([]byte, 1024*1200,1024*1200)
        
        m, err := ws.Read(msg)// m 4092
        if err != nil {
            log15.Error("ws read error", "error", err)
            return err
        }
        fmt.Println("---",m,string(msg))
        response := string(msg[:m])
        assignmentWebsocket(response)
    }
}

has anyone ever encountered this problem? Thank you

Sep.08,2021

uses the following methods to try to read:

func WebsocketCliet(url, protocol, origin string) {
   fmt.Println("Starting ws Client")
   //ws, err := websocket.Dial(fmt.Sprintf("ws://%s/ws", address), "", fmt.Sprintf("http://%s/", address))
   ws, err := websocket.Dial(url, protocol, origin)
   if err != nil {
      log15.Error("Dial failed: %s\n", "error",err.Error())

   }
   log15.Info("ws connected", "info", "success")
   go sendWSmessage(ws)
   go readWSMessage(ws)


}

func readWSMessage(ws *websocket.Conn)  error{
   for {
      var message string
      // err := websocket.JSON.Receive(ws, &message)
      err := websocket.Message.Receive(ws, &message)
      if err != nil {
         log15.Error("receiveWebsocket ","error", err)
         return err
      }
      assignmentWebsocket(message)
   }
}

func sendWSmessage(ws *websocket.Conn) error {
   for {

      select {
      case params := <-WebsocketParams:
         err := websocket.Message.Send(ws, params)
         if err != nil {
            log15.Error("ws send error", "error", err)
            return err
         }
      }

   }

}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf18ff-31d74.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf18ff-31d74.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?