| 114 | } |
| 115 | |
| 116 | static int redisCreateSocket(redisContext *c, int type) { |
| 117 | redisFD s; |
| 118 | if ((s = socket(type, SOCK_STREAM, 0)) == REDIS_INVALID_FD) { |
| 119 | __redisSetErrorFromErrno(c,REDIS_ERR_IO,NULL); |
| 120 | return REDIS_ERR; |
| 121 | } |
| 122 | c->fd = s; |
| 123 | if (type == AF_INET) { |
| 124 | if (redisSetReuseAddr(c) == REDIS_ERR) { |
| 125 | return REDIS_ERR; |
| 126 | } |
| 127 | } |
| 128 | return REDIS_OK; |
| 129 | } |
| 130 | |
| 131 | static int redisSetBlocking(redisContext *c, int blocking) { |
| 132 | #ifndef _WIN32 |
no test coverage detected