rllib  1
Classes | Defines | Functions
rldataprovider.cpp File Reference
#include "rldataprovider.h"
#include <stdio.h>
#include <string.h>
Include dependency graph for rldataprovider.cpp:

Go to the source code of this file.

Classes

struct  WORKER_DATA

Defines

#define CLIENT_TIMEOUT   1000

Functions

static void * workerThread (void *arg)
static void * rlDataProviderAccept (void *arg)

Define Documentation

#define CLIENT_TIMEOUT   1000

Definition at line 333 of file rldataprovider.cpp.


Function Documentation

static void* rlDataProviderAccept ( void *  arg) [static]

Definition at line 593 of file rldataprovider.cpp.

{
  int s;
  rlThread worker;
  WORKER_DATA worker_data;
  rlDataProviderThreads *provider_threads;
  THREAD_PARAM *p = (THREAD_PARAM *) arg;
  if(arg == NULL) return NULL;
  provider_threads = (rlDataProviderThreads *) p->user;
  if(provider_threads == NULL) return NULL;
  rlSocket socket("localhost",provider_threads->port,0);

  while(1)
  {
    s = socket.connect();
    if(s == -1) break;
    worker_data.thread = provider_threads;
    worker_data.socket = s;
    worker.create(workerThread,&worker_data);
    rlsleep(100);
  }
  return NULL;
}
static void* workerThread ( void *  arg) [static]

Definition at line 580 of file rldataprovider.cpp.

{
  WORKER_DATA *worker_data;
  THREAD_PARAM *p = (THREAD_PARAM *) arg;
  if(arg == NULL) return NULL;
  worker_data = (WORKER_DATA *) p->user;
  rlSocket socket(worker_data->socket);

  worker_data->thread->provider->run(&socket);

  return NULL;
}