mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-20 16:48:35 +01:00
works with gigabit
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@94 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
int sockfd;
|
||||
extern int sockfd;
|
||||
|
||||
|
||||
void error(char *msg)
|
||||
@@ -18,7 +18,9 @@ int main(int argc, char *argv[])
|
||||
int portno, b;
|
||||
char cmd[100];
|
||||
int retval=OK;
|
||||
|
||||
int sd, fd;
|
||||
|
||||
|
||||
if (argc==1) {
|
||||
portno = DEFAULT_PORTNO;
|
||||
sprintf(cmd,"%s %d &",argv[0],DEFAULT_PORTNO+1);
|
||||
@@ -37,8 +39,12 @@ int main(int argc, char *argv[])
|
||||
init_detector(b);
|
||||
|
||||
|
||||
bindSocket(portno);
|
||||
if (getServerError()) {
|
||||
sd=bindSocket(portno);
|
||||
|
||||
sockfd=sd;
|
||||
|
||||
|
||||
if (getServerError(sd)) {
|
||||
printf("server error!\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -58,21 +64,21 @@ int main(int argc, char *argv[])
|
||||
#ifdef VERY_VERBOSE
|
||||
printf("Waiting for client call\n");
|
||||
#endif
|
||||
acceptConnection();
|
||||
fd=acceptConnection(sockfd);
|
||||
#ifdef VERY_VERBOSE
|
||||
printf("Conenction accepted\n");
|
||||
#endif
|
||||
retval=decode_function();
|
||||
#ifdef VERY_VERBOSE
|
||||
retval=decode_function(fd);
|
||||
//#ifdef VERY_VERBOSE
|
||||
printf("function executed\n");
|
||||
#endif
|
||||
closeConnection();
|
||||
//#endif
|
||||
closeConnection(fd);
|
||||
#ifdef VERY_VERBOSE
|
||||
printf("connection closed\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
exitServer();
|
||||
exitServer(sockfd);
|
||||
printf("Goodbye!\n");
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user