Fix/connection listener (#777)

Fix add/remove connection listener

In case we call the RemoveConnListener from Java then
we lose the reference from the original instance
This commit is contained in:
Zoltan Papp
2023-04-03 16:59:13 +02:00
committed by GitHub
parent 769388cd21
commit 86f9051a30
4 changed files with 111 additions and 44 deletions

View File

@ -118,12 +118,12 @@ func (c *Client) PeersList() *PeerInfoArray {
return &PeerInfoArray{items: peerInfos}
}
// AddConnectionListener add new network connection listener
func (c *Client) AddConnectionListener(listener ConnectionListener) {
c.recorder.AddConnectionListener(listener)
// SetConnectionListener set the network connection listener
func (c *Client) SetConnectionListener(listener ConnectionListener) {
c.recorder.SetConnectionListener(listener)
}
// RemoveConnectionListener remove connection listener
func (c *Client) RemoveConnectionListener(listener ConnectionListener) {
c.recorder.RemoveConnectionListener(listener)
func (c *Client) RemoveConnectionListener() {
c.recorder.RemoveConnectionListener()
}