mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 06:42:16 +00:00
wsConnection: call onDisconnect
This commit is contained in:
parent
47f5e37205
commit
a01c226dc4
@ -457,10 +457,13 @@ func (wsc *wsConnection) OnStart() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// OnStop is a nop.
|
// OnStop implements cmn.Service by calling OnDisconnect callback.
|
||||||
func (wsc *wsConnection) OnStop() {
|
func (wsc *wsConnection) OnStop() {
|
||||||
// Both read and write loops close the websocket connection when they exit their loops.
|
// Both read and write loops close the websocket connection when they exit their loops.
|
||||||
// The writeChan is never closed, to allow WriteRPCResponse() to fail.
|
// The writeChan is never closed, to allow WriteRPCResponse() to fail.
|
||||||
|
if wsc.onDisconnect != nil {
|
||||||
|
wsc.onDisconnect(wsc.remoteAddr)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRemoteAddr returns the remote address of the underlying connection.
|
// GetRemoteAddr returns the remote address of the underlying connection.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user