Update documentation to explicitly state that applications must break out of a
read loop on error.
Detect application read loops spinning on a failed connection and panic.
Detect concurrent writes and panic. The detection is best-effort.
Update documentation to state that connections respond to close frames.
- Use new closeError type for reporting close frames to the application.
- Use closeError with code 1006 when the peer closes connection without
sending a close frame. The error io.ErrUnexpectedEOF was used
previously. This change helps developers distinguish abnormal closure
and an unexpected EOF in the JSON parser.
- Modify data message reader to return io.ErrUnexpectedEOF if a close
message is received before the final frame of the message.
- Modify NextReader to return io.ErrUnexpectedEOF if underlying
connection returns io.EOF before a close message.
- Use io.ReadFull instead of similar function in package.
- Return from Read with partial data. Don't attempt to fill buffer.
- Do not return net.Error with Temporary() == true