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