Lines Matching refs:sock

98 PHPDBG_API int phpdbg_consume_bytes(int sock, char *ptr, int len, int tmo) {  argument
105 pfd.fd = sock;
117 FD_SET(sock, &readfds);
134 int can_read = recv(sock, p, i, MSG_PEEK);
144 got_now = recv(sock, p, i, 0);
147 got_now = recv(sock, p, i, 0);
162 PHPDBG_API int phpdbg_send_bytes(int sock, const char *ptr, int len) { argument
167 sent = send(sock, p, i, 0);
179 PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo) { argument
183 return phpdbg_consume_bytes(sock, ptr, len, tmo);
187 ret = read(sock, ptr, len);
193 static int phpdbg_output_pager(int sock, const char *ptr, int len) { argument
202 bytes += write(sock, ptr + bytes, (p - ptr) - bytes);
206 zend_quiet_write(sock, ZEND_STRL("\r---Type <return> to continue or q <return> to quit---"));
211 write(sock, "\r", 1);
216 bytes += write(sock, ptr + bytes, len - bytes);
218 bytes += write(sock, ptr, len);
223 PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len) { argument
225 return phpdbg_send_bytes(sock, ptr, len);
230 && PHPDBG_G(io)[PHPDBG_STDOUT].fd == sock
232 return phpdbg_output_pager(sock, ptr, len);
235 return write(sock, ptr, len);
258 int sock = -1, rc; local
310 return sock;
320 return sock;
324 return sock;
327 if((sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) == -1) {
335 return sock;
338 if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char*) &reuse, sizeof(reuse)) == -1) {
339 phpdbg_close_socket(sock);
340 return sock;
348 return sock;
351 PHPDBG_API void phpdbg_close_socket(int sock) { argument
352 if (sock >= 0) {
354 closesocket(sock);
356 shutdown(sock, SHUT_RDWR);
357 close(sock);