Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using WindowedRequestTracking, if the enquire_link expires, the bind is closed but doesnt restart #151

Open
laduchesneau opened this issue Sep 4, 2024 · 2 comments
Labels

Comments

@laduchesneau
Copy link
Collaborator

laduchesneau commented Sep 4, 2024

The OnExpiredPduRequest is using the transceivable.go Close() 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
}
laduchesneau added a commit to laduchesneau/gosmpp that referenced this issue Sep 4, 2024
@icoder-new
Copy link

Hi, is this related to issue #154 problem?

@laduchesneau
Copy link
Collaborator Author

laduchesneau commented Nov 15, 2024

No. its for #152.
This issue does not impact OnAllPdu configs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants