NotifyClose closes the connection and notifies that the connection was closed.
()
| 49 | |
| 50 | // NotifyClose closes the connection and notifies that the connection was closed. |
| 51 | func (c *client) NotifyClose() { |
| 52 | c.once.Do(func() { |
| 53 | c.conn.Close() |
| 54 | close(c.write) |
| 55 | c.onClose(c) |
| 56 | }) |
| 57 | } |
| 58 | |
| 59 | // startWriteHandler starts listening on the client connection. As we do not need anything from the client, |
| 60 | // we ignore incoming messages. Leaves the loop on errors. |
no test coverage detected