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@370 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2012-12-06 14:22:08 +00:00
parent f20e40025b
commit e4d477b53e
5 changed files with 134 additions and 29 deletions

View File

@ -41,18 +41,26 @@ slsReceiverFunctionList::slsReceiverFunctionList(bool shortfname):
status(IDLE),
latestData(NULL),
udpSocket(NULL),
server_port(DEFAULT_UDP_PORT),
server_port(DEFAULT_UDP_PORTNO),
fifo(NULL)
{
strcpy(savefilename,"");
strcpy(actualfilename,"");
strcpy(filePath,"");
strcpy(fileName,"run");
eth = new char[MAX_STR_LENGTH];
strcpy(eth,"");
}
void slsReceiverFunctionList::setEthernetInterface(char* c){
strcpy(eth,c);
}
int slsReceiverFunctionList::getFrameIndex(){
if(startFrameIndex==-1)
frameIndex=0;
@ -216,7 +224,11 @@ int slsReceiverFunctionList::startListening(){
// very end of the program.
do {
udpSocket = new genericSocket(server_port,genericSocket::UDP);
if(!strlen(eth)){
cout<<"error:eth is empty:"<<eth<<endl;
break;
}
udpSocket = new genericSocket(server_port,genericSocket::UDP,eth);
if (udpSocket->getErrorStatus()){
break;
}
@ -251,7 +263,7 @@ int slsReceiverFunctionList::startListening(){
if(fifo->isFull())
;//cout<<"**********************FIFO FULLLLLLLL************************"<<endl;
else{
cout<<"read index:"<<(int)(*(int*)buffer)<<endl;
//cout<<"read index:"<<(int)(*(int*)buffer)<<endl;
dataReadFrame = new dataStruct;
dataReadFrame->buffer=buffer;
dataReadFrame->rc=rc;