about mysql_ping() function

2008-12-29 Thread raid fifa
Hi guys,

I used mysql_ping() function in my program. But when I unplug the network wire 
between client and MySQL server, my program has no response as mysql_ping() can 
not return value and hanged there.

Is this a bug of mysql_ping() ? or any other advice?

thanks!!!

*^_^*


  ___ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/

Re: about mysql_ping() function

2008-12-29 Thread Warren Young

raid fifa wrote:


Is this a bug of mysql_ping() ? or any other advice?


Probably not.  I think you'll find that it *does* time out, just after a 
longer period than you'd prefer.  Timeouts of 30, 60 and 120 seconds are 
common in network code, because it's not possible to reliably determine 
that a link is down until then.


Your OS might have a setting that makes it close all sockets using an 
interface that just lost its physical link to the network.  This is 
often more trouble than it's worth, because the link might come back up 
before any of those sockets need to send data again.  If you need 
immediate notification that the link to the DB is down, though, it might 
be what you want.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org