]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
oddeleni sendpointu
authorMartin Molnar <molnar@sum.(none)>
Mon, 26 Nov 2007 19:50:24 +0000 (20:50 +0100)
committerMartin Molnar <molnar@sum.(none)>
Mon, 26 Nov 2007 19:50:24 +0000 (20:50 +0100)
wme_test/wclient.c

index f1f0192b03e3dab93d530cd8737b210ca964eda0..d3a6dbca86bee2b8911b785ad6a5836e329d8266 100644 (file)
@@ -25,7 +25,7 @@
 #define BASE_PORT       5100
 #define AC_QUEUES       4
 #define MAX_SENDENDPOINTS  10
-#define MTU             1450 //1500 minus something for sure
+#define MTU             800 
 
 
 enum {  AC_VO = 0,
@@ -69,7 +69,7 @@ struct send_endpoint {
 };
 
 struct {
-       struct send_endpoint epoint[MAX_SENDENDPOINTS];
+       struct send_endpoint epoint[1];
        unsigned int nr_epoints;
 } sendpoints;
 
@@ -249,7 +249,7 @@ void* sender(void* endpoint)
 
 int main(int argc, char *argv[])
 {
-       int ac, rc;
+       int ac, i, rc;
        pthread_attr_t attr;
        pthread_t thread;
 
@@ -279,20 +279,25 @@ int main(int argc, char *argv[])
        sendpoints.epoint[AC_VI].period_nsec = 19080;
        
        sendpoints.epoint[AC_VO].ac = AC_VO;
-       sendpoints.epoint[AC_VO].period_nsec = 90000000;
+       sendpoints.epoint[AC_VO].period_nsec = 300000;
        */
                
-       sendpoints.epoint[AC_BE].ac = AC_BE;
-       sendpoints.epoint[AC_BE].period_nsec = 0;
+       /*sendpoints.epoint[AC_BE].ac = AC_BE;
+       sendpoints.epoint[AC_BE].period_nsec = 760000;
 
        sendpoints.epoint[AC_BK].ac = AC_BK;
-       sendpoints.epoint[AC_BK].period_nsec = 757;
+       sendpoints.epoint[AC_BK].period_nsec = 757000;
        
        sendpoints.epoint[AC_VI].ac = AC_VI;
-       sendpoints.epoint[AC_VI].period_nsec = 90000000;
+       sendpoints.epoint[AC_VI].period_nsec = 9908000;
        
        sendpoints.epoint[AC_VO].ac = AC_VO;
        sendpoints.epoint[AC_VO].period_nsec = 90000000;
+       */
+
+       sendpoints.epoint[0].ac = AC_BE;
+       sendpoints.epoint[0].period_nsec = 1000000;
+       sendpoints.nr_epoints = 1;
 
        if (signal(SIGTERM, stopper) == SIG_ERR) {
                perror("Error in signal registration");
@@ -304,7 +309,7 @@ int main(int argc, char *argv[])
                exit(1);
        }
        
-       sendpoints.nr_epoints = 4;
+       /* create four receivers each per AC */
        for (ac = AC_QUEUES - 1; ac >= 0; ac--) {
                ac_sockfd[ac] = create_ac_socket(ac);
                rc = pthread_create(&thread, &attr, receiver, (void*) ac);
@@ -312,8 +317,11 @@ int main(int argc, char *argv[])
                        printf("Error while creating receiver %d\n",rc);
                        return 1;
                }
-               
-               rc = pthread_create(&thread, &attr, sender, (void*) &sendpoints.epoint[ac]);
+       }               
+                       
+       /* create sendpoints */
+       for (i = 0; i < sendpoints.nr_epoints; i++) {
+               rc = pthread_create(&thread, &attr, sender, (void*) &sendpoints.epoint[i]);
                if (rc) {
                        printf("Error while creating sender %d\n",rc);
                        return 1;