Hi,
Just now i read carefully your previous mail....i don't know if is possible
to create a socket/used with PHP.
In principle a client socket it's some like this:

if ((sock=socket(AF_INET,SOCK_STREAM,0))<0)         --create socket file
    {
.perror("Can't create socket: socket()");
.exit(1);
    }
    servAddr.sin_family=AF_INET;
    servAddr.sin_addr.s_addr=inet_addr("your_server_ip");
    servAddr.sin_port=htons(atoi(port_number);

int z=send(sock,something_to_send,strlen(something),0);   --return number of
bytes which was send
close(socket);

...if  z is not >0 then server is not alive...

Regards,
Gelu

_____________________________________________________
G.NET SOFTWARE COMPANY

Permanent e-mail address : [EMAIL PROTECTED]
                                          [EMAIL PROTECTED]
----- Original Message -----
From: "Melvyn Sopacua" <[EMAIL PROTECTED]>
To: "MySQL General" <[EMAIL PROTECTED]>
Sent: Sunday, June 02, 2002 8:31 PM
Subject: mysql_ping()


> Hi,
>
> I've got a function/method in php, where socket communication is used,
> to determin if a host is live - however - there is drawback, because
> it's being registered as an invalid connection and the host gets blocked.
>
> Now - whether this is acceptable behavior (I can't turn the whole thing
off,
> while I really don't need it, cause all relevant mysql servers are on
> internal networks) is another matter.
>
> What I'd like to do, is mimmick mysql_ping() behavior, so that it's a
valid
> connection. However - I'm not that farmiliar with C and it's scattered
over
> several functions, constants and so on.
>
> So - in general - what would socket communication look like, to
succesfully
> ping a database?
>
> PS.: the reason for using sockets is explained in this article:
> http://phpbuilder.com/columns/tanoviceanu20000912.php3
>
>
>
> Best regards,
>
> Melvyn Sopacua
> WebMaster IDG.nl
> _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> If it applies, where it applies - this email is a personal
> contribution and does not reflect the views of my employer
> IDG.nl.
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to