public IEnumerable <CMoveResponse> GetResponse(CMoveRequest cMove, Entity ae)
{
var client = new TcpClient();
client.Connect(IPAddress.Parse(ae.IpAddress), ae.Port);
var assoc = new Association(this, client)
{
AeTitle = ae.AeTitle
};
PDataMessenger.Send(cMove, assoc);
List <CMoveResponse> responses = new List <CMoveResponse>();
EvilDICOM.Network.Services.DIMSEService.DIMSEResponseHandler <CMoveResponse> action = null;
action = (resp, asc) =>
{
responses.Add(resp);
if (resp.Status != (ushort)Status.PENDING)
{
this.DIMSEService.CMoveResponseReceived -= action;
}
};
this.DIMSEService.CMoveResponseReceived += action;
assoc.Listen();
return(responses);
}