perl, connect and timeout

Поиск
Список
Период
Сортировка
От Bill Carlson
Тема perl, connect and timeout
Дата
Msg-id Pine.LNX.3.95.980227173914.28331A-100000@wally.kinze.com
обсуждение исходный текст
Список pgsql-interfaces
Hello,

I have a perl script that is giving me fits.

The basic system accesses postgres across a network. I am trying to code
for things like network failures, etc., basically if the backend is not
available or ready I need to process locally and in a hurry, so any delay
is not acceptable.

I am using the Pg module right now, I have looked at DBI, but would prefer
to use the Pg for now.

I am simulating the network failure by pulling the plug on the nic (worst
case scenario...:) )

$conn->status returns connection good after this (?), doing a $conn->reset
sends me into never-never land for a couple of minutes ( I assume this is
a timeout somewhere, is it adjustable at the frontend at runtime?)

I finally worked around that by using alarm(), but after getting to where
$conn->status does return CONNECTION_BAD, I have so far been unable to
reconnect to the backend!

Is there something I am missing? There has got to be a better way to do
what I need.


Any pointers appreciated!

Bill Carlson            |    Opinions expressed are my own
KINZE Manufacturing, Inc.    |    not my employer's.


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: "Chihiro Sakamaki"
Дата:
Сообщение: subscribe
Следующее
От: Constantin Teodorescu
Дата:
Сообщение: PgAccess 0.80 is working good on postgreSQL 6.3 latest snapshot