Hello Hans-Werner,
On Monday 21 March 2016 10:38:55 Hans-Werner Hilse wrote:
Hi,
Am 2016-03-21 10:13, schrieb Sven Eckelmann:
+int connect_tcp(struct interface *interface, const struct in6_addr *dest) +{ [...] +}
Wouldn't this hang for a while and make the alfred server "unresponsive" when the remote is not reachable at this moment?.
Yes, it most definitely would, you're right.
If the route I'm following is generally right, I think I'll work on this part (*that* I can make into a different commit). The connect() can be made non-blocking, and I would add the socket and the request to send to a list (possibly using the transaction list that already exists right now).
I think you are on the right track - in the ticket, we discussed whether we do TCP or just decrease the fragment size, but doing TCP is probably the more reliable option to do.
I agree that we should definitely use nonblocking operation.
I was also thinking that we might want to use TCP in general when the packet size reaches a certain threshold (e.g. >3kB), and always use UDP for small packets. Then we would also not need the commandline option (unless you think we should leave a way to force a mode). Any thoughts on that?
I don't think you have to split your patch further, at least I don't see a good way right now. I didn't do a deep review yet, but can do in the next iteration with the nonblocking stuff implemented. :)
Thanks a lot for taking care of this! Simon