I am trying to use datasockets to talk between two machines on my LAN. The
machine running the datasocket server is called SERVER. I start up the
datasocket server and then run my application on the server which calls:
iRc = DS_Open ("dstp://SERVER/broadcaster", DSConst_ReadAutoUpdate,
FaxBroadcastUnit, NULL, &dshGateway);
Here is the callback FaxBroadcastUnit():
void CVICALLBACK FaxBroadcastUnit (DSHandle dsHandle, int event,
void *callbackData)
{
char szRecordNum[6],szResultCode[5],szCurrentRecno[6];
iRc = DS_GetAttrValue (dshGateway, "batchrecordnumber", CAVT_CSTRING,
szRecordNum, sizeof(szRecordNum), NULL, NULL);
if (iRc<0)
return;
iRc = DS_G
etAttrValue (dshGateway, "batchresultcode", CAVT_CSTRING,
szResultCode, sizeof(szResultCode), NULL, NULL);
iRc = DS_GetAttrValue (dshGateway, "currentrecordnumber", CAVT_CSTRING,
szCurrentRecno, sizeof(szCurrentRecno), NULL, NULL);
printf("%s, %s %s\n",szRecordNum,szResultCode,szCurrentRecno);
}
On the other machine called MEDIASERVER I run a program which includes the
following lines:
iRc = DS_Open ("dstp://SERVER/broadcaster", DSConst_Write, NULL,
NULL, &dshServer);
DS_SetAttrValue (dshServer, "batchrecordnumber", CAVT_CSTRING, "1", 0,0);
DS_SetAttrValue (dshServer, "batchresultcode", CAVT_CSTRING, " ", 0,0);
DS_SetAttrValue (dshServer, "currentrecordnumber", CAVT_CSTRING, "1", 0,0);
iRc = DS_Update (dshServer);
I thought that running DS_Update() would cause the callback
FaxBroadcastUnit() to be called, but it doesn't work. I took a look at the
datasocket server applet. The number of processes connected remains at 1,
while th
e number of packets increased from 3 to 9. What am I doing wrong????
-Rich Bernstein