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:
l_maliakal_d
2012-11-20 16:50:36 +00:00
parent 97ed3e8872
commit ffd392c7eb
6 changed files with 153 additions and 99 deletions

View File

@ -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