included the stop receiver function for the users

This commit is contained in:
Maliakal Dhanya
2014-05-23 14:50:11 +02:00
parent af89269c0c
commit 567501c6f7
6 changed files with 64 additions and 33 deletions

View File

@@ -31,6 +31,7 @@ slsReceiverTCPIPInterface::~slsReceiverTCPIPInterface() {
slsReceiverTCPIPInterface::slsReceiverTCPIPInterface(int argc, char *argv[], int &success):
myDetectorType(GOTTHARD),
slsReceiverFunctions(NULL),
ret(OK),
lockStatus(0),
shortFrame(-1),
@@ -168,7 +169,6 @@ slsReceiverTCPIPInterface::slsReceiverTCPIPInterface(int argc, char *argv[], int
//Catch signal SIGINT to close files properly
signal(SIGINT,staticCloseFile);
file_des=socket->getFileDes();
socketDescriptor=socket->getsocketDescriptor();
@@ -178,6 +178,7 @@ slsReceiverTCPIPInterface::slsReceiverTCPIPInterface(int argc, char *argv[], int
}
void slsReceiverTCPIPInterface::start(){
int v=slsReceiverDefs::OK;
@@ -203,9 +204,18 @@ void slsReceiverTCPIPInterface::start(){
#endif
}
}
}
void slsReceiverTCPIPInterface::stop(){
//shut down udp socket
if(slsReceiverFunctions)
slsReceiverFunctions->shutDownUDPSocket();
//disconnect and delete socket
socket->Disconnect();
delete socket;
//close file and exit
closeFile(0);
}