Close will close the connection to the server. This call will release all blocking calls, such as Flush() and NextMsg()
()
| 6040 | // Close will close the connection to the server. This call will release |
| 6041 | // all blocking calls, such as Flush() and NextMsg() |
| 6042 | func (nc *Conn) Close() { |
| 6043 | if nc != nil { |
| 6044 | // This will be a no-op if the connection was not websocket. |
| 6045 | // We do this here as opposed to inside close() because we want |
| 6046 | // to do this only for the final user-driven close of the client. |
| 6047 | // Otherwise, we would need to change close() to pass a boolean |
| 6048 | // indicating that this is the case. |
| 6049 | nc.wsClose() |
| 6050 | nc.close(CLOSED, !nc.Opts.NoCallbacksAfterClientClose, nil) |
| 6051 | } |
| 6052 | } |
| 6053 | |
| 6054 | // IsClosed tests if a Conn has been closed. |
| 6055 | func (nc *Conn) IsClosed() bool { |