FACT++  1.0
static void rpc_user_routine ( void *  tagp,
void *  bufp,
int *  sizep 
)
static

Definition at line 518 of file diccpp.cxx.

References dic_get_quality(), DimClient::getNoDataCopy(), DimRpcInfo::itsConnected, DimRpcInfo::itsData, DimRpcInfo::itsDataSize, DimRpcInfo::itsHandler, DimRpcInfo::itsInit, DimRpcInfo::itsNolinkBuf, DimRpcInfo::itsNolinkSize, DimRpcInfo::itsSize, DimRpcInfo::itsWaiting, DimRpcInfo::rpcInfoHandler(), size, DimTimer::stop(), t, wake_up, and DimRpcInfo::wakeUp.

Referenced by DimRpcInfo::doIt(), and DimRpcInfo::subscribe().

519 {
520 // int *tag = (int *)tagp;
521  char *buf = (char *)bufp;
522  int size = *sizep;
523 // int id = *tag;
524  DimRpcInfo *t;
525  int quality;
526 
527 // t = (DimRpcInfo *)id_get_ptr(id, SRC_DIC);
528  t = *(DimRpcInfo **)tagp;
529  quality = dic_get_quality(0);
530  if(quality == -1)
531  {
532  buf = (char *)t->itsNolinkBuf;
533  size = t->itsNolinkSize;
534  }
535  if(DimClient::getNoDataCopy() == 0)
536  {
537  if(size > 0)
538  {
539  if(!t->itsDataSize)
540  {
541  t->itsData = new char[size];
542  t->itsDataSize = size;
543  }
544  else if(t->itsDataSize < size)
545  {
546  delete[] (char *)(t->itsData);
547  t->itsData = new char[size];
548  t->itsDataSize = size;
549  }
550  }
551  else if (size == 0)
552  {
553  if(t->itsDataSize)
554  {
555  delete[] (char *)(t->itsData);
556  t->itsDataSize = 0;
557  }
558  }
559  }
560  if(!t->itsConnected)
561  {
562  t->itsConnected = 1;
563  }
564  if(t->itsWaiting)
565  {
566  t->stop();
567 //dim_print_date_time();
568 //printf("DIM RPC: Stopped Timer, Data Received for %s\n", t->getName());
569  if(DimClient::getNoDataCopy() == 0)
570  {
571  if(size > 0)
572  memcpy(t->itsData, buf, (size_t)size);
573  else
574  t->itsData = buf;
575  }
576  else
577  t->itsData = buf;
578  t->itsSize = size;
579  t->wakeUp = 1;
580  if(t->itsInit)
581  {
582  t->itsWaiting = 1;
584  }
585  if(t->itsWaiting != 2)
586  t->itsWaiting = 0;
587  }
588 #ifdef __VMS
589  sys$wake(0,0);
590 #endif
591 #ifdef WIN32
592  wake_up();
593 #endif
594 }
static int wake_up
Definition: dns.c:81
virtual void rpcInfoHandler()
Definition: diccpp.cxx:661
void * itsNolinkBuf
Definition: dic.hxx:364
int dic_get_quality(unsigned serv_id)
Definition: dic.c:937
void * itsData
Definition: dic.hxx:356
int itsDataSize
Definition: dic.hxx:357
int stop()
Definition: dimcpp.cxx:39
DimRpcInfo * itsHandler
Definition: dic.hxx:366
static int getNoDataCopy()
Definition: diccpp.cxx:1241
int itsNolinkSize
Definition: dic.hxx:365
int size
Definition: db_dim_server.c:17
TT t
Definition: test_client.c:26
int wakeUp
Definition: dic.hxx:361
int itsConnected
Definition: dic.hxx:363
int itsInit
Definition: dic.hxx:355
int itsSize
Definition: dic.hxx:360
int itsWaiting
Definition: dic.hxx:362

+ Here is the call graph for this function:

+ Here is the caller graph for this function: