<p>hi all,</p><p>i wander the code below is right or not:</p><p>A. thread for receiving data from multicast address</p><p>DWORD WINAPI recv_thread(LPVOID lp)<br>{<br> AVIOContext * io_ctx = NULL;<br> unsigned char recv_buffer[1024];</p><p> int ret = avio_open2( &io_ctx, "udp://224.124.0.1:5000?multicast=1&ttl=16&reuse=1&pkt_size=256", AVIO_FLAG_READ_WRITE, NULL, NULL);<br> ret = url_setbufsize(io_ctx, 4096); </p><p>ret = avio_read(io_ctx, recv_buffer, sizeof(recv_buffer)); // is this okay?</p><p> avio_close(io_ctx);</p><p> return 0;<br>}</p><p>B. thread to send data to multicast address.</p><p>DWORD WINAPI send_thread(LPVOID lp)<br>{<br> AVIOContext * io_ctx = NULL;<br> uint8_t snd_buf[] = "abcdef";</p><p> int ret = avio_open2( &io_ctx, "udp://224.124.0.1:5000?multicast=1&ttl=16&reuse=1&pkt_size=256", AVIO_FLAG_READ_WRITE, NULL, NULL);<br> ret = url_setbufsize(io_ctx, 4096);</p><p> avio_write(io_ctx, snd_buf, sizeof(snd_buf)); // is this okay?</p><p> avio_close(io_ctx);</p><p> return 0;<br>}<font></p><div>is anyone could tell me the result. thanks.</div></font>