Buffered will return the number of bytes buffered to be sent to the server. FIXME(dlc) take into account disconnected state.
()
| 5859 | // Buffered will return the number of bytes buffered to be sent to the server. |
| 5860 | // FIXME(dlc) take into account disconnected state. |
| 5861 | func (nc *Conn) Buffered() (int, error) { |
| 5862 | nc.mu.RLock() |
| 5863 | defer nc.mu.RUnlock() |
| 5864 | if nc.isClosed() || nc.bw == nil { |
| 5865 | return -1, ErrConnectionClosed |
| 5866 | } |
| 5867 | return nc.bw.buffered(), nil |
| 5868 | } |
| 5869 | |
| 5870 | // resendSubscriptions will send our subscription state back to the |
| 5871 | // server. Used in reconnects |