Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix teardown issue of TCP interconnect
Previously, for an interconnect connection, if no data are available at sender peer, the sender sends a customized EOS packet to the receiver and disables further send operations using shutdown(SHUT_WR), then somehow, the sender closes the connection totally with close() immediately and it counts on the kernel and TCP stack to guarantee the data been transformed to the receiver. The problem is, on some platform, if the connection is closed on one side, the TCP behave is undetermined, the packets may be lost and receiver may report an unexpected error. The correct way is sender blocks on the connection until receiver getting the EOS packet and close its peer, then the sender can close the connection safely.
- Loading branch information