MCPcopy Create free account
hub / github.com/acl-dev/acl / acl_socket_read

Function acl_socket_read

lib_acl/src/stdlib/sys/acl_sys_socket.c:150–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150int acl_socket_read(ACL_SOCKET fd, void *buf, size_t size,
151 int timeout, ACL_VSTREAM *fp, void *arg acl_unused)
152{
153 if (fp != NULL && fp->read_ready) {
154 fp->read_ready = 0;
155 } else if (timeout > 0) {
156 if (fp != NULL && ACL_VSTREAM_IS_MS(fp)) {
157 if (acl_read_wait_ms(fd, timeout) < 0) {
158 return -1;
159 }
160 } else if (acl_read_wait(fd, timeout) < 0) {
161 return -1;
162 }
163 }
164
165#if defined(_WIN32) || defined(_WIN64)
166# ifdef SYS_WSA_API
167 WSABUF wsabuf;
168 wsabuf.buf = buf;
169 wsabuf.len = (int) size;
170 DWORD flags = 0;
171 return WSARecv(fd, &wsabuf, (int) size, 0, &flags, 0, 0);
172# else
173 return __sys_recv(fd, buf, (int) size, 0);
174# endif
175#else
176 return __sys_recv(fd, buf, (int) size, 0);
177#endif
178}
179
180int acl_socket_write(ACL_SOCKET fd, const void *buf, size_t size,
181 int timeout, ACL_VSTREAM *fp acl_unused, void *arg acl_unused)

Callers 8

winapi_hookFunction · 0.85
acl_mbox.cFile · 0.85
acl_timed_readFunction · 0.85
__sock_readMethod · 0.85
sock_readMethod · 0.85
sock_readMethod · 0.85
event_mutex.cppFile · 0.85
network_biopair_interopFunction · 0.85

Calls 2

acl_read_wait_msFunction · 0.85
acl_read_waitFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…