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

Asynchrony in the communication to the RTI #303

Open
byeonggiljun opened this issue Aug 23, 2024 · 0 comments
Open

Asynchrony in the communication to the RTI #303

byeonggiljun opened this issue Aug 23, 2024 · 0 comments

Comments

@byeonggiljun
Copy link
Collaborator

byeonggiljun commented Aug 23, 2024

When the federate terminates, we call socket.end() in shutdownRTIClient() right after sending Resign and LTC signals. Both functions socket.write() and socket.end() are asynchronous, socket.end() may close the connection before socket.write() puts messages into the buffer although socket.end() flushes the buffer before terminating. To resolve this, we may have to manage a variable or buffer to check whether there is any pending data that needs to be sent.

protected _finish(): void {
this.sendRTILogicalTimeComplete(this.util.getCurrentTag());
this.sendRTIResign();
this.shutdownRTIClient();
super._finish();
}

In the CI (which has low computation power), I occasionally see an error ERROR (reactor-ts): Error [ERR_STREAM_WRITE_AFTER_END]: write after end.

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