-
Notifications
You must be signed in to change notification settings - Fork 593
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
Fix C# connection to correctly mark message as sent #3072
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -607,15 +607,23 @@ public override bool startAsync(int operation, Ice.Internal.AsyncCallback comple | |
observerStartWrite(_writeStream.getBuffer()); | ||
} | ||
|
||
bool completed; | ||
if (_transceiver.startWrite(_writeStream.getBuffer(), completedCallback, this, out completed)) | ||
bool messageWritten = false; | ||
bool completedSynchronously = | ||
_transceiver.startWrite( | ||
_writeStream.getBuffer(), | ||
completedCallback, | ||
this, | ||
out messageWritten); | ||
// If the startWrite call consumed the complete buffer, we assume the message is sent now for | ||
// at-most-once semantics. | ||
if (messageWritten && _sendStreams.Count > 0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Not from this PR) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems |
||
{ | ||
// If the write completed immediately and the buffer | ||
if (completed && _sendStreams.Count > 0) | ||
{ | ||
// The whole message is written, assume it's sent now for at-most-once semantics. | ||
_sendStreams.First.Value.isSent = true; | ||
} | ||
_sendStreams.First.Value.isSent = true; | ||
} | ||
|
||
if (completedSynchronously) | ||
{ | ||
// If the write completed synchronously, we need to call the completedCallback. | ||
completedCallback(this); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me why the C# startWrite has such a complicated signature compared to the C++ startWrite. In C++, we don't have this "completedSynchronously" return value.
In any case, assuming this complicated C# API is warranted, we should:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do that in a separate PR?
It does not work with .NET 4.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this can wait until a follow-up PR.