included settting up of udpport from client and getting receiver mac from receiver and also listening to only one ethernet interface

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@371 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2012-12-06 14:27:52 +00:00
parent e4d477b53e
commit ac2c4211e2
11 changed files with 294 additions and 173 deletions

View File

@ -1,5 +1,4 @@
#include "receiverInterface.h"
#include "sls_detector_defs.h"
#include <sys/types.h>
@ -44,6 +43,29 @@ int receiverInterface::sendString(int fnum, char retval[], char arg[]){
int receiverInterface::sendUDPDetails(int fnum, char retval[], char arg[2][MAX_STR_LENGTH]){
char args[2][MAX_STR_LENGTH];
int ret = slsDetectorDefs::FAIL;
char mess[100] = "";
if (dataSocket) {
if (dataSocket->Connect()>=0) {
dataSocket->SendDataOnly(&fnum,sizeof(fnum));
dataSocket->SendDataOnly(arg,sizeof(args));
dataSocket->ReceiveDataOnly(&ret,sizeof(ret));
if (ret==slsDetectorDefs::FAIL){
dataSocket->ReceiveDataOnly(mess,sizeof(mess));
std::cout<< "Receiver returned error: " << mess << std::endl;
}
else
dataSocket->ReceiveDataOnly(retval,MAX_STR_LENGTH);
}
dataSocket->Disconnect();
}
return ret;
}
int receiverInterface::sendInt(int fnum, int &retval, int arg){
int ret = slsDetectorDefs::FAIL;
char mess[100] = "";