Lines Matching refs:socket
122 php_socket *socket = socket_from_obj(object); in socket_free_obj() local
124 if (Z_ISUNDEF(socket->zstream)) { in socket_free_obj()
125 if (!IS_INVALID_SOCKET(socket)) { in socket_free_obj()
126 close(socket->bsd_socket); in socket_free_obj()
129 zval_ptr_dtor(&socket->zstream); in socket_free_obj()
132 zend_object_std_dtor(&socket->std); in socket_free_obj()
137 php_socket *socket = socket_from_obj(object); in socket_get_gc() local
139 *table = &socket->zstream; in socket_get_gc()
237 sock->bsd_socket = socket(PF_INET, SOCK_STREAM, 0);
1101 php_sock->bsd_socket = socket(domain, type, protocol);
2118 int socket_import_file_descriptor(PHP_SOCKET socket, php_socket *retsock) argument
2130 retsock->bsd_socket = socket;
2134 if (getsockopt(socket, SOL_SOCKET, SO_DOMAIN, &type, &type_len) == 0) {
2138 if (getsockname(socket, (struct sockaddr*)&addr, &addr_len) == 0) {
2147 t = fcntl(socket, F_GETFL);
2165 PHP_SOCKET socket; /* fd */ local
2172 if (php_stream_cast(stream, PHP_STREAM_AS_SOCKETD, (void**)&socket, 1)) {
2180 if (!socket_import_file_descriptor(socket, retsock)) {
2208 php_socket *socket; local
2218 socket = Z_SOCKET_P(zsocket);
2219 ENSURE_SOCKET_VALID(socket);
2223 if (!Z_ISUNDEF(socket->zstream)) {
2224 RETURN_COPY(&socket->zstream);
2229 if (socket->type == PF_INET
2231 || socket->type == PF_INET6
2237 getsockopt(socket->bsd_socket, SOL_SOCKET, SO_TYPE, (char *) &protoid, &protoidlen);
2243 getsockopt(socket->bsd_socket, SOL_SOCKET, SO_PROTOCOL, (char *) &protoid, &protoidlen);
2255 } else if (socket->type == PF_UNIX) {
2259 getsockopt(socket->bsd_socket, SOL_SOCKET, SO_TYPE, (char *) &type, &typelen);
2280 stream = php_stream_sock_open_from_socket(socket->bsd_socket, 0);
2289 stream_data->socket = socket->bsd_socket;
2290 stream_data->is_blocked = socket->blocking;
2294 php_stream_to_zval(stream, &socket->zstream);
2296 RETURN_COPY(&socket->zstream);
2384 …php_sock->bsd_socket = socket(ai->addrinfo.ai_family, ai->addrinfo.ai_socktype, ai->addrinfo.ai_pr…
2447 …php_sock->bsd_socket = socket(ai->addrinfo.ai_family, ai->addrinfo.ai_socktype, ai->addrinfo.ai_pr…
2552 php_socket *socket; local
2561 socket = Z_SOCKET_P(zsocket);
2562 ENSURE_SOCKET_VALID(socket);
2564 if (SOCKET_ERROR == WSADuplicateSocket(socket->bsd_socket, (DWORD)target_pid, &wi)) {