6 #include "test_config.h"
12 #include <sys/socket.h>
13 #include <netinet/in.h>
14 #include <arpa/inet.h>
18 char msg[MSGBUFFSIZE];
20 frsh_resource_id_t resource_id = TEST_RESOURCE_ID;
21 frsh_stream_id_t stream_id = TEST_STREAM_ID;
22 long int num_msg = TEST_NUM_MSG;
23 size_t msg_size = MSGBUFFSIZE;
28 frsh_receive_endpoint_t repoint;
31 frsh_network_address_t from;
32 frsh_receive_endpoint_protocol_info_t recv_pinfo;
33 frsh_endpoint_queueing_info_t qinfo;
35 recv_pinfo.body = NULL;
37 /* local_addr should be handled when creating socket */
38 //TODO: Segmentation fault in wvtest.sh file after calling WVPASSNE
39 //WVPASSNE(frsh_receive_endpoint_create(resource_id, stream_id, qinfo, recv_pinfo, &repoint), 0);
40 if (frsh_receive_endpoint_create(resource_id, stream_id, qinfo, recv_pinfo,
45 while (count != num_msg){
47 WVPASSEQ(frsh_receive_sync(repoint, msg, msg_size, &len, &from), msg_size);
50 /* TODO: destroy vres and send enpoint */
55 int main(int argc, char* argv[])
60 bool opt_daemon = false;
61 char *opt_pidfile = NULL;
63 while ((opt = getopt (argc, argv, "e:p:m:")) != -1) {
71 stream_id = atoi(optarg);
74 num_msg = atoi(optarg);
77 printf("Usage: %s -e -p stream_id -m num_msg\n",
83 forb_daemon_prepare(opt_pidfile);
86 WVPASSEQ(receiver(), 1);