33 filename =
new char [strlen(file)+1];
44 if(
fp != NULL) fclose((FILE *)
fp);
74 cptr = strchr(buf,
'\n');
75 if(cptr != NULL) *cptr =
'\0';
90 char name[1024],time[50];
94 strcpy(time,t.
getTimeString()); time[10] =
'_'; time[13] =
'_'; time[16] =
'\0';
97 strcat(name,
".rlEventLog");
100 fp = (
void *) fopen(name,
"w",
"shr=get");
102 fp = (
void *) fopen(name,
"w");
107 fprintf((FILE *)
fp,
"%s",event);
139 thread = worker_data->
thread;
144 ret = socket->
readStr(message,
sizeof(message)-1);
162 socket =
new rlSocket(
"localhost",port,0);
167 worker_data.
thread = thread;
189 if(
port <= 0)
return;
190 if(
port >= 256*256)
return;
const char * getTimeString()
void putEvent(const char *event)
rlEventLogServer(const char *filename=NULL, int max_events=10000)
rlEventLogServerThreads * thread
char memory[rlMAX_MESSAGES *rlMAX_EVENT]
int create(void *(*func)(void *), void *argument)
static void * workerThread(void *arg)
rlEventLogServerThreads(int port, rlEventLogServer *event_log_server)
int readStr(char *buf, int len, int timeout=0)
virtual ~rlEventLogServer()
const char * getEvent(char *buf, int *num)
char * rlstrncpy(char *dest, const char *source, int n)
static void * rlAcceptThread(void *arg)
rlDataProviderThreads * thread
rlEventLogServer * event_log_server
virtual ~rlEventLogServerThreads()