]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
The size of socket's send buffers set to zero to decrease queuing delay.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 22 Jan 2008 09:14:41 +0000 (10:14 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 22 Jan 2008 09:14:41 +0000 (10:14 +0100)
wme_test/wclient.c

index f105f85fd7787e6e73f89194c7bf720db4296bcb..200928fa20d10f8ad9ec17691606b841994a8160 100644 (file)
@@ -275,6 +275,12 @@ int create_ac_socket(unsigned int ac)
                return -1;
        }
 
+       int sndbuf = 0;
+       if (setsockopt(sockfd,SOL_SOCKET,SO_SNDBUF,&sndbuf,sizeof(sndbuf)) == -1) {
+               perror("Unable to set socket buffer size");
+               return -1;
+       }
+
        
        //tos = ((AC_NUM - ac) *2 - 1)*32;
        tos = ac_to_tos[ac];
@@ -723,6 +729,9 @@ int main(int argc, char *argv[])
        /* create four receivers each per AC */
        for (ac = AC_NUM - 1; ac >= 0; ac--) {
                ac_sockfd[ac] = create_ac_socket(ac);
+               if (ac_sockfd[ac] < 0) {
+                       return 1;
+               }
                rc = pthread_create(&receivers[ac].thread, &attr, receiver, (void*) ac);
                if (rc) {
                        fprintf(stderr, "Error while creating receiver %d\n",rc);