why "timeout" in selectReadable function is not be used?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
xusujin
Posts: 1
Joined: Fri, 2009-02-06, 06:50

why "timeout" in selectReadable function is not be used?

#1 Post by xusujin » Fri, 2009-02-06, 09:59

why "timeout" in selectReadable function is not be used?


OFCondition
DIMSE_moveUser(
/* in */
T_ASC_Association *assoc,
T_ASC_PresentationContextID presID,
T_DIMSE_C_MoveRQ *request,
DcmDataset *requestIdentifiers,
DIMSE_MoveUserCallback callback, void *callbackData,
/* blocking info for response */
T_DIMSE_BlockingMode blockMode, int timeout,
/* sub-operation provider callback */
T_ASC_Network *net,
DIMSE_SubOpProviderCallback subOpCallback, void *subOpCallbackData,
/* out */
T_DIMSE_C_MoveRSP *response, DcmDataset **statusDetail,
DcmDataset **rspIds,
OFBool ignorePendingDatasets)
{
T_DIMSE_Message req, rsp;
DIC_US msgId;
int responseCount = 0;
T_ASC_Association *subAssoc = NULL;
DIC_US status = STATUS_Pending;

if (requestIdentifiers == NULL) return DIMSE_NULLKEY;

bzero((char*)&req, sizeof(req));
bzero((char*)&rsp, sizeof(rsp));

req.CommandField = DIMSE_C_MOVE_RQ;
request->DataSetType = DIMSE_DATASET_PRESENT;
req.msg.CMoveRQ = *request;

msgId = request->MessageID;

OFCondition cond = DIMSE_sendMessageUsingMemoryData(assoc, presID, &req,
NULL, requestIdentifiers,
NULL, NULL);
if (cond != EC_Normal) {
return cond;
}

/* receive responses */

while (cond == EC_Normal && status == STATUS_Pending) {

/* if user wants, multiplex between net/subAssoc
* and move responses over main assoc.
*/
switch (selectReadable(assoc, net, subAssoc, blockMode, timeout)) {


...


static int
selectReadable(T_ASC_Association *assoc,
T_ASC_Network *net, T_ASC_Association *subAssoc,
T_DIMSE_BlockingMode blockMode, int timeout)
{
T_ASC_Association *assocList[2];
int assocCount = 0;

if (net != NULL && subAssoc == NULL) {
if (ASC_associationWaiting(net, 0)) {
/* association request waiting on network */
return 2;
}
}
assocList[0] = assoc;
assocCount = 1;
assocList[1] = subAssoc;
if (subAssoc != NULL) assocCount++;
if (subAssoc == NULL) {
timeout = 1; /* poll wait until an assoc req or move rsp */
} else {
if (blockMode == DIMSE_BLOCKING) {
timeout = 10000; /* a long time */
}
}

Post Reply

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 1 guest