Notify the reader that we are done with the connect, where "read" operations happen synchronously and under the connection lock. After this point, "read" will be happening from the read loop, without the connection lock. Note: this runs under the connection lock.
()
| 2257 | // |
| 2258 | // Note: this runs under the connection lock. |
| 2259 | func (r *natsReader) doneWithConnect() { |
| 2260 | if wsr, ok := r.r.(*websocketReader); ok { |
| 2261 | wsr.doneWithConnect() |
| 2262 | } |
| 2263 | } |
| 2264 | |
| 2265 | func (r *natsReader) Read() ([]byte, error) { |
| 2266 | if r.off >= 0 { |