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;
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++) {
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);
sleep(1);
}
- if (fwp_vres_destroy(vres_d1) < 0) {
+ if (fwp_vres_destroy(vres) < 0) {
perror("Unable to destroy vres1\n");
return NULL;
}
{
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;
}
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;
}