Close closes the connection.
()
| 41 | |
| 42 | // Close closes the connection. |
| 43 | func (c *client) Close() { |
| 44 | c.once.Do(func() { |
| 45 | c.conn.Close() |
| 46 | close(c.write) |
| 47 | }) |
| 48 | } |
| 49 | |
| 50 | // NotifyClose closes the connection and notifies that the connection was closed. |
| 51 | func (c *client) NotifyClose() { |