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:
l_maliakal_d
2012-01-13 09:39:02 +00:00
parent 9f7fe775e8
commit f0ec4036be
6 changed files with 993 additions and 627 deletions

View File

@@ -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;