Commit 710248a5 authored by Mahmoud Bakhtvar's avatar Mahmoud Bakhtvar

Select it used for proper error handling

parent ba7beb66
......@@ -25,21 +25,17 @@ namespace C_UI
{
var client = new DicomClient(_storeServerHost, _storeServerPort, false, _storeServerAET, _aet);
client.NegotiateAsyncOps();
dicomFiles.ToObservable().Subscribe(
async onNext =>
{
var request = new DicomCStoreRequest(onNext);
request.OnResponseReceived += (req, response) => logger.Info($"{response.Status}-{onNext}" );
await client.AddRequestAsync(request);
await client.SendAsync();
},
onError =>
{
logger.Error(onError.Message);
}
);
dicomFiles.ToObservable()
.Select(async onNext =>
{
var request = new DicomCStoreRequest(onNext);
request.OnResponseReceived += (req, response) => logger.Info($"{response.Status}-{onNext}");
await client.AddRequestAsync(request);
await client.SendAsync();
})
.Subscribe(x => { }, onError => logger.Error(onError.Message), () => { });
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment