OnConnect adds a callback which is called when client connects to a remote kite.
(handler func())
| 609 | // OnConnect adds a callback which is called when client connects |
| 610 | // to a remote kite. |
| 611 | func (c *Client) OnConnect(handler func()) { |
| 612 | c.m.Lock() |
| 613 | c.onConnectHandlers = append(c.onConnectHandlers, handler) |
| 614 | c.m.Unlock() |
| 615 | } |
| 616 | |
| 617 | // OnDisconnect adds a callback which is called when client disconnects |
| 618 | // from a remote kite. |