mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 19:30:03 +02:00

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@1 951219d9-93cf-4727-9268-0efd64621fa3
42 lines
652 B
C
Executable File
42 lines
652 B
C
Executable File
/* A simple server in the internet domain using TCP
|
|
The port number is passed as an argument */
|
|
#include "communication_funcs.h"
|
|
#include "firmware_funcs.h"
|
|
|
|
|
|
int sockfd;
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
int portno;
|
|
int retval=0;
|
|
|
|
portno = DEFAULT_PORTNO;
|
|
|
|
|
|
bindSocket(portno);
|
|
if (getServerError())
|
|
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();
|
|
retval=stopStateMachine();
|
|
closeConnection();
|
|
}
|
|
|
|
exitServer();
|
|
printf("Goodbye!\n");
|
|
|
|
return 0;
|
|
}
|
|
|