+ sock->is_blocked = 1;
+ sock->timeout.tv_sec = FG(default_socket_timeout);
+ sock->timeout.tv_usec = 0;
+
+ /* we don't know the socket until we have determined if we are binding or
+ * connecting */
+ sock->socket = fd_out[0];
+
+ stream = php_stream_alloc_rel(&php_stream_socket_ops, sock, NULL, "r+");
+
+ if (stream == NULL) {
+ pefree(sock, 0);
+ return NULL;
+ }