Skip to content

Commit 11d880e

Browse files
committed
Always send an ACK message after a reconnection
1 parent 387b611 commit 11d880e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/vs/base/parts/ipc/common/ipc.net.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -901,17 +901,18 @@ export class PersistentProtocol implements IMessagePassingProtocol {
901901
public endAcceptReconnection(): void {
902902
this._isReconnecting = false;
903903

904+
// After a reconnection, let the other party know (again) which messages have been received.
905+
// (perhaps the other party didn't receive a previous ACK)
906+
this._incomingAckId = this._incomingMsgId;
907+
const msg = new ProtocolMessage(ProtocolMessageType.Ack, 0, this._incomingAckId, getEmptyBuffer());
908+
this._socketWriter.write(msg);
909+
904910
// Send again all unacknowledged messages
905911
const toSend = this._outgoingUnackMsg.toArray();
906912
for (let i = 0, len = toSend.length; i < len; i++) {
907913
this._socketWriter.write(toSend[i]);
908914
}
909915
this._recvAckCheck();
910-
911-
// After a reconnection, let the other party know (again) which messages have been received.
912-
// (perhaps the other party didn't receive a previous ACK)
913-
this._incomingAckId = 0;
914-
this._sendAckCheck();
915916
}
916917

917918
public acceptDisconnect(): void {

0 commit comments

Comments
 (0)