Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - MsgSendv riov question: (5 Items)
   
MsgSendv riov question  
I am using MsgSendv and server sends MSgReply like this:

char     desc_buf_out[MAX_CHARS_IN_A_LINE];
MsgReply(rcvid, EOK, desc_buf_out, sizeof(desc_buf_out));

My client is looking like this:

    iov_t              *iovrcv=calloc(1,sizeof(iov_t));
    char               rcv[1024]={0}
if (MsgSendv(server_coid, iovin_render, 3 , iovrcv, 1 ) == -1)
    {
    	printf("error sending message to server\n");
        fprintf( stderr,
                 "%s: %s\n",
                 __func__,
                 strerror( errno ) );
        return EXIT_FAILURE;
    }

    SETIOV (iovrcv + 0, rcv, sizeof(rcv));
    printf("iovrcv=%s\n", rcv);



But I get nothing in my rcv buffer?
Can you tell me why and what is the correct way of doing it so I receive my data correctly? I expect to receive string.
Re: MsgSendv riov question  
You need to do the SETIOV before the MsgSend.

Sent from my BlackBerry 10 smartphone on the Rogers network.
  Original Message
From: Mehdi Karimi
Sent: Tuesday, October 28, 2014 1:59 PM
To: general-community
Reply To: general-community@community.qnx.com
Subject: MsgSendv riov question


I am using MsgSendv and server sends MSgReply like this:

char     desc_buf_out[MAX_CHARS_IN_A_LINE];
MsgReply(rcvid, EOK, desc_buf_out, sizeof(desc_buf_out));

My client is looking like this:

    iov_t              *iovrcv=calloc(1,sizeof(iov_t));
    char               rcv[1024]={0}
if (MsgSendv(server_coid, iovin_render, 3 , iovrcv, 1 ) == -1)
    {
        printf("error sending message to server\n");
        fprintf( stderr,
                 "%s: %s\n",
                 __func__,
                 strerror( errno ) );
        return EXIT_FAILURE;
    }

    SETIOV (iovrcv + 0, rcv, sizeof(rcv));
    printf("iovrcv=%s\n", rcv);



But I get nothing in my rcv buffer?
Can you tell me why and what is the correct way of doing it so I receive my data correctly? I expect to receive string.



_______________________________________________

General
http://community.qnx.com/sf/go/post112199
To cancel your subscription to this discussion, please e-mail general-community-unsubscribe@community.qnx.com
Re: MsgSendv riov question  
I did that too and it did not work, are you sure I am not missing anything?
Re: MsgSendv riov question  
I have also tried using MsgSendvs, and it did not work!

char               rcv[1024]={0};

if (MsgSendvs(server_coid, iovin_render, 3 , rcv, sizeof(rcv) ) == -1)
    {
    	printf("error sending message to server\n");
        fprintf( stderr,
                 "%s: %s\n",
                 __func__,
                 strerror( errno ) );
        return EXIT_FAILURE;
    }


    printf("rcv=%s\n", rcv);


Why?
Re: MsgSendv riov question  
I resolved the issue. Thanks for help. After debugging turned out my server was not sending it properly in the buffer I 
assigned.