after client connect to hololens, while send the image, just close the client app,. the socket server in hololens should catch and handle the exception: WinRT : An existing connection was forcibly closed by the remote host.
but actually, it does not. so the server was crashed.
in cpp file Shared\HoloLensForCV\SensorFrameStreamingServer.cpp
void SensorFrameStreamingServer::SendImage( SensorFrameStreamHeader^ header, const Platform::Array^ data)
..............
Concurrency::create_task(_writer->StoreAsync()).then(
[&](Concurrency::task writeTask)
{
try
{
// Try getting an exception.
writeTask.get();
// throw ref new Platform::Exception(E_FAIL);
_writeInProgress = false;
}
catch (Platform::Exception^ exception)
{
dbg::trace(L"SensorFrameStreamingServer::SensorFrameStreamingServer: StoreAsync %s",
exception->Message->Data());
_socket = nullptr;
}
// return writeTask;
})
...........
after client connect to hololens, while send the image, just close the client app,. the socket server in hololens should catch and handle the exception: WinRT : An existing connection was forcibly closed by the remote host.
but actually, it does not. so the server was crashed.
I also raised a ticket for MS's visual studio support engineer, no response till now, below is the link https://learn.microsoft.com/en-us/answers/questions/1340260/cant-catch-the-exception-in-the-concurrency-runtim
anyone meet the same issue can ping me, thank you very much