/* A simple server in the internet domain using TCP The port number is passed as an argument */ /** \file mainReceiver.cpp This file is an example of how to implement the slsDetectorUsers class You can compile it linking it to the slsDetector library gcc mainReceiver.cpp -L lib -l SlsDetector -lm -lpthread where lib is the location of libSlsDetector.so */ #include "slsReceiverUsers.h" #include //SIGINT #include //EXIT #include using namespace std; /** close file if receiver process is interrupted */ void closeFile(int p){ cout<<"close file in receiver"<registerCallBackStartAcquisition(func,arg); /* callback argument is total farmes caught registerCallBackAcquisitionFinished(void (*func)(int, void*),void *arg); */ //receiver->registerCallBackAcquisitionFinished(func,arg); /* args to raw data ready callback are framenum datapointer file descriptor guidatapointer (NULL, no data required) NEVER DELETE THE DATA POINTER REMEMBER THAT THE CALLBACK IS BLOCKING registerCallBackRawDataReady(void (*func)(int, char*, FILE*, char*, void*),void *arg); */ //receiver->registerCallBackRawDataReady(func,arg); /* start receiver to listen for commands from the client (and data from detectors when expected */ receiver->start(); return 0; }