| 741 } |
741 } |
| 742 |
742 |
| 743 /* we use non-blocking mode to speed up connection */ |
743 /* we use non-blocking mode to speed up connection */ |
| 744 flags = fcntl(fd, F_GETFL); |
744 flags = fcntl(fd, F_GETFL); |
| 745 fcntl(fd, F_SETFL, flags | O_NONBLOCK); |
745 fcntl(fd, F_SETFL, flags | O_NONBLOCK); |
| |
746 #ifndef _WIN32 |
| |
747 fcntl(fd, F_SETFD, FD_CLOEXEC); |
| |
748 #endif |
| 746 |
749 |
| 747 /* From Unix-socket-FAQ: http://www.faqs.org/faqs/unix-faq/socket/ |
750 /* From Unix-socket-FAQ: http://www.faqs.org/faqs/unix-faq/socket/ |
| 748 * |
751 * |
| 749 * If a UDP socket is unconnected, which is the normal state after a |
752 * If a UDP socket is unconnected, which is the normal state after a |
| 750 * bind() call, then send() or write() are not allowed, since no |
753 * bind() call, then send() or write() are not allowed, since no |