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);
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);
/* 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?)