(E-Mail Removed) wrote:
> What's the difference between a socket server done in this way:
>
> accept() -> select() -> recv() --- in a blocking way ---
>
> And a socket server done in this way?
>
> accept() -> recv() --- in a blocking way ---
>
> Both wait for data to be received before to unblock. But what's the
> advantage and disavantage in the first and in second solution?
You are correct, there's little functional difference between the two. The
first example is what you would use if you put the socket into non-blocking
mode, this would allow you to handle other events in addition to receiving
packets.