If I have a UDP server that handles incoming requests with recvfrom
, processes the requests that come in (possibly time consuming), possibly sends back a response, and then calls recvfrom
again, is it better to create a new sock_fd with the information in sockaddr* from
to send the response back with or to use the server's sock_fd to send a response?
Basically, the question is do I want the overhead of having to create a new sock_fd, or do I want my server to be able to handle requests without having to wait to send the previous request a response.
I can't decide based on the application's needs, because this will be used in a library (hence I don't know whether there will need to be a response or not, and how long it will take to process the request).
I fail to see how this is not a real question. The question is clearly asked in the bolded section above, and in the last part of the first sentence