The OnExpiredPduRequest is using the transceivable.goClose() function. This uses the ExplicitClosing state. Therefor the OnClosed() and the session restart() functions are not called.
if t.settings.OnExpiredPduRequest != nil {
bindClose := t.settings.OnExpiredPduRequest(request.PDU)
if bindClose {
_ = t.Close()
}
}
The normal behavior when any PDU expires, the user should be is given the choice to restart the bind by returning true to the closeBind variable. When its requested, the ConnectionIssue state should be used.
if t.settings.OnExpiredPduRequest != nil {
bindClose := t.settings.OnExpiredPduRequest(request.PDU)
if bindClose {
t.closing(ConnectionIssue)
}
}
func (t *transceivable) closing(state State) {
if atomic.CompareAndSwapInt32(&t.aliveState, Alive, Closed) {
t.in.closing(StoppingProcessOnly)
t.out.closing(StoppingProcessOnly)
// close underlying conn
_ = t.conn.Close()
// notify transceiver closed
if t.settings.OnClosed != nil {
t.settings.OnClosed(state)
}
}
return
}
The
OnExpiredPduRequest
is using the transceivable.goClose()
function. This uses theExplicitClosing
state. Therefor theOnClosed()
and the sessionrestart()
functions are not called.The normal behavior when any PDU expires, the user should be is given the choice to restart the bind by returning true to the
closeBind
variable. When its requested, theConnectionIssue
state should be used.