SetClosedHandler will set the closed event handler.
(cb ConnHandler)
| 1741 | |
| 1742 | // SetClosedHandler will set the closed event handler. |
| 1743 | func (nc *Conn) SetClosedHandler(cb ConnHandler) { |
| 1744 | if nc == nil { |
| 1745 | return |
| 1746 | } |
| 1747 | nc.mu.Lock() |
| 1748 | defer nc.mu.Unlock() |
| 1749 | nc.Opts.ClosedCB = cb |
| 1750 | } |
| 1751 | |
| 1752 | // ClosedHandler will return the closed event handler. |
| 1753 | func (nc *Conn) ClosedHandler() ConnHandler { |
no outgoing calls