hi
I am facing a problem with socket and I would be glad if you could help ...
The problem is that when I send data more than once it blocks, e.g:
//--- client ---
//..
send(sock, buf_1, sizeof(buf_1), 0);
for (x10){
//...
send(sock, buf_2, sizeof(buf_2), 0);
if (recv(sock, buf_2, sizeof(buf_2), 0)<0) printf("recv_2() failed");
//...
}
for (x20){
//...
send(sock, buf_3, sizeof(buf_3), 0);
if (recv(sock, buf_3, sizeof(buf_3), 0)<0) printf("recv_3() failed");
//...
}
//...
//--- server---
//...
if (recv(sock, buf_1, sizeof(buf_1), 0)<0) printf("recv_1() failed");
for (x10){
if (recv(sock, buf_2, sizeof(buf_2), 0)<0) printf("recv_2() failed");
//...
send(sock, buf_2, sizeof(buf_2), 0);
}
for (x20){
if (recv(sock, buf_3, sizeof(buf_3), 0)<0) printf("recv_3() failed");
//...
send(sock, buf_3, sizeof(buf_3), 0);
}
//...
the exchange blocks just after the first send()
, is there any idea?
Does udp support also multiple sendto()
?
Thanks for your answer -