mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-16 14:57:13 +02:00
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:
@ -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;
|
||||
|
Reference in New Issue
Block a user