Lines Matching refs:socket
63 if (!sock || sock->socket == -1) { in php_sockop_write()
73 …didwrite = send(sock->socket, buf, XP_SOCK_BUF_SIZE(count), (sock->is_blocked && ptimeout) ? MSG_D… in php_sockop_write()
86 retval = php_pollfd_for(sock->socket, POLLOUT, ptimeout); in php_sockop_write()
128 if (!sock || sock->socket == -1) { in php_sock_stream_wait_for_data()
140 retval = php_pollfd_for(sock->socket, PHP_POLLREADABLE, ptimeout); in php_sock_stream_wait_for_data()
159 if (!sock || sock->socket == -1) { in php_sockop_read()
169 …nr_bytes = recv(sock->socket, buf, XP_SOCK_BUF_SIZE(count), (sock->is_blocked && sock->timeout.tv_… in php_sockop_read()
204 if (sock->socket == -1) in php_sockop_close()
205 sock->socket = SOCK_ERR; in php_sockop_close()
207 if (sock->socket != SOCK_ERR) { in php_sockop_close()
210 shutdown(sock->socket, SHUT_RD); in php_sockop_close()
219 n = php_pollfd_for_ms(sock->socket, POLLOUT, 500); in php_sockop_close()
222 closesocket(sock->socket); in php_sockop_close()
223 sock->socket = SOCK_ERR; in php_sockop_close()
237 return fsync(sock->socket); in php_sockop_flush()
249 return zend_fstat(sock->socket, &ssb->sb); in php_sockop_stat()
259 ret = sendto(sock->socket, buf, XP_SOCK_BUF_SIZE(buflen), flags, addr, XP_SOCK_BUF_SIZE(addrlen)); in sock_sendto()
264 …return ((ret = send(sock->socket, buf, buflen > INT_MAX ? INT_MAX : (int)buflen, flags)) == SOCK_C… in sock_sendto()
266 return ((ret = send(sock->socket, buf, buflen, flags)) == SOCK_CONN_ERR) ? -1 : ret; in sock_sendto()
281 ret = recvfrom(sock->socket, buf, XP_SOCK_BUF_SIZE(buflen), flags, (struct sockaddr*)&sa, &sl); in sock_recvfrom()
302 ret = recv(sock->socket, buf, XP_SOCK_BUF_SIZE(buflen), flags); in sock_recvfrom()
338 if (sock->socket == -1) { in php_sockop_set_option()
346 php_pollfd_for(sock->socket, PHP_POLLREADABLE|POLLPRI, &tv) > 0 in php_sockop_set_option()
356 ret = recv(sock->socket, &buf, sizeof(buf), MSG_PEEK|MSG_DONTWAIT); in php_sockop_set_option()
368 if (SUCCESS == php_set_sock_blocking(sock->socket, value)) { in php_sockop_set_option()
390 xparam->outputs.returncode = (listen(sock->socket, xparam->inputs.backlog) == 0) ? 0: -1; in php_sockop_set_option()
394 xparam->outputs.returncode = php_network_get_sock_name(sock->socket, in php_sockop_set_option()
402 xparam->outputs.returncode = php_network_get_peer_name(sock->socket, in php_sockop_set_option()
458 xparam->outputs.returncode = shutdown(sock->socket, shutdown_how[xparam->how]); in php_sockop_set_option()
482 *(FILE**)ret = fdopen(sock->socket, stream->mode); in php_sockop_cast()
492 *(php_socket_t *)ret = sock->socket; in php_sockop_cast()
648 …sock->socket = socket(PF_UNIX, stream->ops == &php_stream_unix_socket_ops ? SOCK_STREAM : SOCK_DGR… in php_tcp_sockop_bind()
650 if (sock->socket == SOCK_ERR) { in php_tcp_sockop_bind()
661 return bind(sock->socket, (const struct sockaddr *)&unix_addr, in php_tcp_sockop_bind()
701 sock->socket = php_network_bind_socket_to_local_addr(host, portno, in php_tcp_sockop_bind()
712 return sock->socket == -1 ? -1 : 0; in php_tcp_sockop_bind()
729 …sock->socket = socket(PF_UNIX, stream->ops == &php_stream_unix_socket_ops ? SOCK_STREAM : SOCK_DGR… in php_tcp_sockop_connect()
731 if (sock->socket == SOCK_ERR) { in php_tcp_sockop_connect()
740 ret = php_network_connect_socket(sock->socket, in php_tcp_sockop_connect()
795 sock->socket = php_network_connect_socket_to_host(host, portno, in php_tcp_sockop_connect()
806 ret = sock->socket == -1 ? -1 : 0; in php_tcp_sockop_connect()
843 clisock = php_network_accept_incoming(sock->socket, in php_tcp_sockop_accept()
856 clisockdata->socket = clisock; in php_tcp_sockop_accept()
943 sock->socket = -1; in php_stream_generic_socket_factory()