microsoft/AMBROSIA

Messages get out of sync

Closed this issue · 2 comments

I'm getting this exception in Immortal.cs using latest bits:

 var s = String.Format("Illegal leading byte in message: {0}", firstByte);

But if I revert this recent change:

int commitID = await this._ambrosiaReceiveFromStream.ReadIntFixedAsync(cancelTokenSource.Token);
bytesToRead = await this._ambrosiaReceiveFromStream.ReadIntFixedAsync(cancelTokenSource.Token);
long checkBytes = await this._ambrosiaReceiveFromStream.ReadLongFixedAsync(cancelTokenSource.Token);
long writeSeqID = await this._ambrosiaReceiveFromStream.ReadLongFixedAsync(cancelTokenSource.Token);

to this, then everything works fine:

int commitID = this._ambrosiaReceiveFromStream.ReadIntFixed();
bytesToRead = this._ambrosiaReceiveFromStream.ReadIntFixed();
long checkBytes = this._ambrosiaReceiveFromStream.ReadLongFixed();
long writeSeqID = this._ambrosiaReceiveFromStream.ReadLongFixed();

This is what happens when I use the async await version:

image

Never mind it was my bug.