summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/UdpTransceiver.cpp
diff options
context:
space:
mode:
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)
{