storeSCP and ASC_receiveAssociation();

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
markw
Posts: 84
Joined: Mon, 2005-01-17, 01:08

storeSCP and ASC_receiveAssociation();

#1 Post by markw »

Hi,

In the storeSCP application, we wait for an incoming association with:

ASC_receiveAssociation();

This seems to block any other execution of this thread until an association comes in. I'm on windows, is there some way to modify this function to allow processing of messages if they exist in the queue, instead of blocking everything else?

Thanks!

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1461
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

If you check how ASC_receiveAssociation() is declared in dcmnet/assoc.h you will notice that this function accepts a number of optional parameters:

Code: Select all

OFCondition 
ASC_receiveAssociation(
    T_ASC_Network * network,
    T_ASC_Association ** association,
    long maxReceivePDUSize,
    void **associatePDU=NULL,
    unsigned long *associatePDUlength=NULL,
    OFBool useSecureLayer=OFFalse,
    DUL_BLOCKOPTIONS block=DUL_BLOCK,
    int timeout=0);
In the last two parameters can specify DUL_NOBLOCK and a timeout (in seconds), causing the function to return with an error code (DUL_NOASSOCIATIONREQUEST) if no association has been received before the timout expires.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 0 guests