]> rtime.felk.cvut.cz Git - frescor/fwp.git/blobdiff - fwp/lib/fwp/tests/fwp_vrestest/fwp_vrestest2.c
Removed "descriptor" types
[frescor/fwp.git] / fwp / lib / fwp / tests / fwp_vrestest / fwp_vrestest2.c
index c1c4d22c8c8c612415033c54307754bcda093d42..d4dbe5c5ef4a45986fdd70666f08218034b5cbf4 100644 (file)
@@ -31,8 +31,8 @@ fwp_endpoint_attr_t attr;
        
 void* sender()
 {
-       fwp_endpoint_d_t sepoint_d1;
-       fwp_vres_d_t vres_d1;
+       fwp_endpoint_t *sepoint;
+       fwp_vres_t *vres;
        struct fwp_vres_params vparam1;
        char msg1[10];
        int count;
@@ -44,18 +44,18 @@ void* sender()
        vparam1.period.tv_nsec = 0; 
        
        printf("Create vres1\n");
-       if (fwp_vres_create(&vparam1, &vres_d1) < 0) {
+       if (fwp_vres_create(&vparam1, &vres) < 0) {
                printf("Unable to open vres1\n");
                return NULL;
        }
        printf("Vres1 created\n");
        
        if (fwp_send_endpoint_create(inet_addr("127.0.0.1"), PORT, &attr, 
-               &sepoint_d1) < 0){
+               &sepoint) < 0){
                return NULL;
        }
        printf("Send endpoint 1 created\n");
-       fwp_send_endpoint_bind(sepoint_d1, vres_d1);
+       fwp_send_endpoint_bind(sepoint, vres);
        
        sleep(2);
        //for (count = 0; count < NUM; count++) {       
@@ -65,7 +65,7 @@ void* sender()
        while (count < NUM){
                count++;
                sprintf(msg1,"msg%d sent\n",count);
-               fwp_send(sepoint_d1, msg1, sizeof(msg1));
+               fwp_send(sepoint, msg1, sizeof(msg1));
        
                printf(msg1);   
                /*clock_gettime(CLOCK_MONOTONIC, &sendtime);
@@ -78,7 +78,7 @@ void* sender()
                sleep(1);
        }
        
-       if (fwp_vres_destroy(vres_d1) < 0) {
+       if (fwp_vres_destroy(vres) < 0) {
                perror("Unable to destroy vres1\n");
                return NULL;
        }
@@ -91,13 +91,13 @@ void* receiver()
 {
         ssize_t len;
        char buffer[30];
-       fwp_endpoint_d_t repoint_d;
+       fwp_endpoint_t *repoint;
        int count;
        struct timespec recvtime;
        fwp_addr_t      from;
        
        /* local_addr should be handled when creating socket */
-       if (fwp_receive_endpoint_create(PORT, &attr, &repoint_d) < 0){
+       if (fwp_receive_endpoint_create(PORT, &attr, &repoint) < 0){
                perror("Not initialized\n");
                return NULL;
        }
@@ -105,7 +105,7 @@ void* receiver()
        
        for (count = 1; count <= NUM; count++) {        
                
-               if ((len = fwp_recv(repoint_d, buffer, sizeof(buffer), &from, 0)) < 0){
+               if ((len = fwp_recv(repoint, buffer, sizeof(buffer), &from, 0)) < 0){
                        perror("Error while receiving data");
                        return NULL;
                }