-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
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.
reactor-ts/src/core/federation.ts
Lines 1449 to 1454 in d028653
| 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.
Metadata
Metadata
Assignees
Labels
No labels