Client socket
| From: | Vinod Panicker | Date: | Wed, 29 May 2002 12:18:34 +0000 |
| Subject: | Client socket | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-84523@lists.php.net to get a copy of this message | ||
Hi,
Continuing with the problem that I've been having...
I made changes to the php_apache.c file and added a new php function of
my own, which is supposed to return the client socket when called from a
php script. Here is the code for the function -
---------------
/* {{{ proto int apache_client_socket()
Get the client socket */
PHP_FUNCTION(apache_client_socket)
{
RETURN_LONG(((request_rec
*)SG(server_context))->connection->client->fd);
}
---------------
I recompiled php and made a module out of it. Worked perfectly. Now, I
wrote a php script with the following code -
---------------
<?
echo apache_client_socket();
?>
---------------
This script I call from the browser, and everytime it displays a '3'. I
even called it from different browser windows, still the same.
That cant be alright since if the fd is 3 as shown in one browser
window, it has to be something different in the other window since the
browser defaults to a keep-alive connection, and the fd's have to be
different.
I'll would tell you why I need the socket, but I've described it so many
times that I'm gonna die :( I'll forward you a mail if you are really
interested.
Tx,
Vinod.
-----------------------------------
Vinod Panicker <vinod@mundu.com>
Sr. Software Designer
Geodesic Information Systems Ltd.