A blocking call is used for connect(). This is a bad
idea, since the waiting time is not specified and in
fact equals several minutes. I don't know how to
influence the timeout, haven't seen any appropriate
option in setsockopt(). If anyone knows, please tell
me. The use of non-blocking call and select() with
timeout seems safe.