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

Connection shutdown after system time changed. #115

Open
ditupao opened this issue May 20, 2022 · 0 comments
Open

Connection shutdown after system time changed. #115

ditupao opened this issue May 20, 2022 · 0 comments

Comments

@ditupao
Copy link

ditupao commented May 20, 2022

In 2.2.1, we check u-test for twice, to confirm connection is lost.

cs104_slave.c:2410

    if (self->outstandingTestFRConMessages > 2) {
            DEBUG_PRINT("Timeout for TESTFR CON message\n");

            /* close connection */
            timeoutsOk = false;

When system is changed to some time later, it cause system sending a u-test frame.
Tcp connection will not be shutdown immediately.

When updated to 2.3.1, this part is rewritten.

cs104_slave.c:2523

     if (checkTestFRConTimeout(self, currentTime)) {
            DEBUG_PRINT("CS104 SLAVE: Timeout for TESTFR CON message\n");

            /* close connection */
            timeoutsOk = false;

When system is changed to some time later, checkTestFRConTimeout returns true.
Tcp connection will be shutdown immediately.

I think we need add a conter to ensure connection is lost.
Just like this :

     if (checkTestFRConTimeout(self, currentTime)) {
            DEBUG_PRINT("CS104 SLAVE: Timeout for TESTFR CON message\n");
            self->unconfirmedTestFRConMessages ++;
            if (self->unconfirmedTestFRConMessages > 2) {
                 /* close connection */
                timeoutsOk = false;
            }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant