summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/UdpTransceiver.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2012-11-22 19:30:43 +0100
committerBenoit Foucher <benoit@zeroc.com>2012-11-22 19:30:43 +0100
commit20be8eb6f1e283a50f2fbcaa68cc0644d6fc5cfd (patch)
treeb2f826d68acd9c795c4ac8f38dc78b650ad8b80c /cpp/src/Ice/UdpTransceiver.cpp
parentICE-4982: correct fix for the UDP assert (diff)
downloadice-20be8eb6f1e283a50f2fbcaa68cc0644d6fc5cfd.tar.bz2
ice-20be8eb6f1e283a50f2fbcaa68cc0644d6fc5cfd.tar.xz
ice-20be8eb6f1e283a50f2fbcaa68cc0644d6fc5cfd.zip
Last attempt to fix ICE-4982 correctly
Diffstat (limited to 'cpp/src/Ice/UdpTransceiver.cpp')
-rw-r--r--cpp/src/Ice/UdpTransceiver.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/cpp/src/Ice/UdpTransceiver.cpp b/cpp/src/Ice/UdpTransceiver.cpp
index 60416db2311..5e9243dcb58 100644
--- a/cpp/src/Ice/UdpTransceiver.cpp
+++ b/cpp/src/Ice/UdpTransceiver.cpp
@@ -447,7 +447,8 @@ IceInternal::UdpTransceiver::startWrite(Buffer& buf)
writer->WriteBytes(ref new Array<unsigned char>(&*buf.i, static_cast<int>(buf.b.size())));
DataWriterStoreOperation^ operation = writer->StoreAsync();
- if(operation->Status == Windows::Foundation::AsyncStatus::Completed)
+ Windows::Foundation::AsyncStatus status = operation->Status;
+ if(status == Windows::Foundation::AsyncStatus::Completed)
{
//
// NOTE: unlike other methods, it's important to modify _write.count
@@ -457,12 +458,23 @@ IceInternal::UdpTransceiver::startWrite(Buffer& buf)
// completed callback.
//
_write.count = operation->GetResults();
+ _completedHandler(SocketOperationWrite);
}
-
- if(!checkIfErrorOrCompleted(SocketOperationWrite, operation))
+ else if(status == Windows::Foundation::AsyncStatus::Started)
{
operation->Completed = _writeOperationCompletedHandler;
}
+ else
+ {
+ if(_state < StateConnected)
+ {
+ checkConnectErrorCode(__FILE__, __LINE__, operation->ErrorCode.Value, _addr.host);
+ }
+ else
+ {
+ checkErrorCode(__FILE__, __LINE__, operation->ErrorCode.Value);
+ }
+ }
}
catch(Platform::Exception^ pex)
{