Returning DimseRSP from a cfind()

68 views
Skip to first unread message

Tamás Sipos

unread,
Apr 3, 2018, 6:41:07 AM4/3/18
to dcm...@googlegroups.com
Right now that's the only way I am able to perform a cfind():

association.cfind("1.2.840.10008.5.1.4.31",
    
0x0000, atts, "1.2.840.10008.1.2",
    
new DimseRSPHandler(assoc.nextMessageID()) {

    
@Override
    
public void onDimseRSP(Association as,
        
Attributes cmd, Attributes data) {

        
super.onDimseRSP(as, cmd, data);

        
// Do something with data...

    
}

});

However, there are other implementations of cfind() that return a DimseRSP object instead of void, but I can't make them work.

DimseRSP rsp = association.cfind("1.2.840.10008.5.1.4.31",
    
0x0000, atts, "1.2.840.10008.1.2", 0);

Attributes data = rsp.getDataset();

System.out.println(data); // prints null.

cfind() seems to be async and I think this causes the problem, but I don't know how to wait for the response before printing the results. Does anybody have a guess?

Tamás Sipos

unread,
Apr 3, 2018, 9:34:56 AM4/3/18
to dcm...@googlegroups.com
I've found the solution. This is the way to go:

...

association.waitForOutstandingRSP();


while(rsp.next()) {
   
Attributes data = rsp.getDataset();
Reply all
Reply to author
Forward
0 new messages