added stop server, the implementation part of the class, and edited slsDetectorServer to include the correct slsDetectorFunctionList.h

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@266 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2012-09-21 16:03:13 +00:00
parent ae9b39fba3
commit aefdcaa82e
3 changed files with 791 additions and 4 deletions

View File

@@ -0,0 +1,41 @@
/* A simple server in the internet domain using TCP
The port number is passed as an argument */
#include "communication_funcs.h"
#include "slsDetectorFirmare_funcs.h"
int sockfd;
int main(int argc, char *argv[])
{
int portno;
int retval=0;
portno = DEFAULT_PORTNO;
bindSocket(portno); //defined in communication_funcs
if (getServerError()) //defined in communication_funcs
return -1;
/* waits for connection */
while(retval!=GOODBYE) {
#ifdef VERBOSE
printf("\n");
#endif
#ifdef VERY_VERBOSE
printf("Stop server: waiting for client call\n");
#endif
acceptConnection(); //defined in communication_funcs
retval=stopStateMachine();//defined in slsDetectorFirmare_funcs
closeConnection(); //defined in communication_funcs
}
exitServer(); //defined in communication_funcs
printf("Goodbye!\n");
return 0;
}