mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-20 16:48:01 +02:00
fixed changing ports inreceiver, included receiver config file
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@351 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@ -12,22 +12,29 @@ using namespace std;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int portno = DEFAULT_PORTNO+2;
|
||||
int retval = slsDetectorDefs::OK;
|
||||
int ret = slsDetectorDefs::OK;
|
||||
MySocketTCP *socket = NULL;
|
||||
string fname = "";
|
||||
|
||||
MySocketTCP *socket = new MySocketTCP(portno);
|
||||
if (socket->getErrorStatus())
|
||||
//parse command line for config
|
||||
for(int iarg=2;iarg<argc;iarg++)
|
||||
if(!strcasecmp(argv[iarg-1],"-config"))
|
||||
fname.assign(argv[iarg]);
|
||||
|
||||
|
||||
|
||||
//reads config file, creates socket, assigns function table
|
||||
slsReceiverFuncs *receiver = new slsReceiverFuncs(socket,fname,ret);
|
||||
if(ret==slsDetectorDefs::FAIL)
|
||||
return -1;
|
||||
|
||||
//assign function table
|
||||
slsReceiverFuncs *receiver = new slsReceiverFuncs(socket);
|
||||
#ifdef VERBOSE
|
||||
cout << "Function table assigned." << endl;
|
||||
#endif
|
||||
|
||||
cout << " Ready..." << endl;
|
||||
//waits for connection
|
||||
while(retval!=GOODBYE) {
|
||||
while(ret!=GOODBYE) {
|
||||
#ifdef VERBOSE
|
||||
cout<< endl;
|
||||
#endif
|
||||
@ -38,7 +45,7 @@ int main(int argc, char *argv[])
|
||||
#ifdef VERY_VERBOSE
|
||||
cout << "Conenction accepted" << endl;
|
||||
#endif
|
||||
retval = receiver->decode_function();
|
||||
ret = receiver->decode_function();
|
||||
#ifdef VERY_VERBOSE
|
||||
cout << "function executed" << endl;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user