IP_RECVERR and Nwrite issue #1804
Replies: 2 comments
-
Hi, I am also not a socket expert, but I believe that it would help if you will give more details about you implementation. I.e., are you using the iperf3 application or the iperf3 library? In either case, can you explain (and show the relevant code) how are you reading the errors in parallel to the iperf3 code? etc. |
Beta Was this translation helpful? Give feedback.
-
I am using the iperf3 application. I added the following line to iperf_common_sockopts: /* */ I modified Nwrite to this: while (nleft > 0) { nleft -= r; As sometimes the return value r = -1. The error reported is "No route to host". This happens relatively infrequently and it depends on the machine. The second attempt to write works OK. I was just curious about why the write behaviour would change. If there was something I was failing to understand. |
Beta Was this translation helpful? Give feedback.
-
Hi, I am not an expert on socket programming, but I am trying to get the network error messages from the stream socket by setting:
setsockopt(s, SOL_IP, IP_RECVERR, &n, sizeof(n));
Which seems to work OK. However occasionally iperf stops working because the write call in Nwrite returns -1. When I look at the errno I see "No route to host" on the machine I am working on.
Normally this would just cause a NET_HARDERROR to be generated and iperf to stop working. If I ignore the error and just try the write again it seems to work OK.
Does anyone have any thoughts / knowledge in this area and can explain whats going on?
Beta Was this translation helpful? Give feedback.
All reactions