MCPcopy Create free account
hub / github.com/F-Stack/f-stack / redisCreateSocket

Function redisCreateSocket

app/redis-6.2.6/deps/hiredis/net.c:116–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116static 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
131static int redisSetBlocking(redisContext *c, int blocking) {
132#ifndef _WIN32

Callers 1

redisContextConnectUnixFunction · 0.85

Calls 3

__redisSetErrorFromErrnoFunction · 0.85
redisSetReuseAddrFunction · 0.85
socketFunction · 0.50

Tested by

no test coverage detected