Commit c1c40df15a9772d0ccf7d1a65fc1a803bce69fa6
- Diff rendering mode:
- inline
- side by side
sockets.c
(4 / 4)
|   | |||
| 22 | 22 | ||
| 23 | 23 | #include "waitforsocket.h" | |
| 24 | 24 | ||
| 25 | static int waitForConnect(int s) | ||
| 25 | static enum returnvalues waitForConnect(int s) | ||
| 26 | 26 | { | |
| 27 | 27 | int selected=0; | |
| 28 | 28 | fd_set rset; | |
| 29 | 29 | fd_set wset; | |
| 30 | 30 | fd_set eset; | |
| 31 | 31 | struct timeval tv; | |
| 32 | int rv=ERR_ERRNO; | ||
| 32 | enum returnvalues rv=ERR_ERRNO; | ||
| 33 | 33 | ||
| 34 | 34 | FD_ZERO(&rset); | |
| 35 | 35 | FD_ZERO(&wset); | |
| … | … | ||
| 63 | 63 | return(rv); | |
| 64 | 64 | } | |
| 65 | 65 | ||
| 66 | int | ||
| 66 | enum returnvalues | ||
| 67 | 67 | attemptConnection(char *host, char *svc) | |
| 68 | 68 | { | |
| 69 | 69 | struct addrinfo hints, *res, *res0; | |
| 70 | int rv=ERR_ERRNO; | ||
| 70 | enum returnvalues rv=ERR_ERRNO; | ||
| 71 | 71 | register int s = -1; | |
| 72 | 72 | struct linger l; | |
| 73 | 73 | int fflags =0; |
waitforsocket.h
(1 / 1)
|   | |||
| 4 | 4 | ||
| 5 | 5 | enum returnvalues { ERR_DNS=-3, ERR_TIMEOUT=-2, ERR_ERRNO=-1, RV_SUCCESS=0 }; | |
| 6 | 6 | ||
| 7 | int attemptConnection(char *, char *); | ||
| 7 | enum returnvalues attemptConnection(char *, char *); |

