Timeout in echoscu or other scu...

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
hamlet
Posts: 13
Joined: Tue, 2004-11-16, 09:53

Timeout in echoscu or other scu...

#1 Post by hamlet » Wed, 2005-03-23, 04:29

Hi,
I try to use echoscu or findscu or movescu or storescu to Q/R Server.
I have add -to param to set timeout (10 sec). Sometime it return error for timeout, sometime it dosen't (especially the server crash).

I have modify ASC_initializeNetwork to set timeout 20, but didn't work.

Code: Select all

OFCondition cond = ASC_initializeNetwork(NET_REQUESTOR, 0, 20, &net);
//OFCondition cond = ASC_initializeNetwork(NET_REQUESTOR, 0, 1000, &net);
I trace into code, hang at ASC_requestAssociation

Code: Select all

cond = ASC_requestAssociation(net, params, &assoc);
.
.
.
    cond = DUL_RequestAssociation(&network->network,
                                  &(*assoc)->params->DULparams,
                                  &(*assoc)->DULassociation, 
                                  retrieveRawPDU);
.
.
.
cond = PRV_NextPDUType(association, DUL_BLOCK, PRV_DEFAULTTIMEOUT, &pduType);
.
.
.
        cond = readPDUHead(association, (*association)->pduHead,
                           sizeof((*association)->pduHead),
                           block, timeout, &(*association)->nextPDUType,
                           &(*association)->nextPDUReserved,
                           &(*association)->nextPDULength);
.
.
.
        cond = readPDUHeadTCP(association, buffer, maxLength, block, timeout,
             &(*association)->nextPDUType, &(*association)->nextPDUReserved, &(*association)->nextPDULength);
.
.
.
OFCondition cond = defragmentTCP((*association)->connection, block, (*association)->timerStart, timeout, buffer, 6, &length);
.
.
.
        do {
          bytesRead = connection->read((char*)b, size_t(l));
        } while (bytesRead == -1 && errno == EINTR);
I see the note at dulfsm.cxx for defragmentTCP
/* start a loop: since we want to receive l bytes of data over the network, */
/* we won't stop waiting for data until we actually did receive l bytes. */

May I set timeout when into do-while loop?

( if I modify PRV_NextPDUType at DUL_RequestAssociation at ASC_requestAssociation:
cond = PRV_NextPDUType(association, DUL_NOBLOCK, NetworkTimeout, &pduType);
is there any side effect?)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest