Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Network read timeout

Status
Not open for further replies.

rotis23

Programmer
Aug 29, 2002
121
GB
Hi All,

I have a process that is having it's (MySQL DBI and Net::LDAP) connections terminated by a firewall after a period of inactivity. The problem is that the process (client) doesn't know this and attempts to read (well, actually the ldaps earch function and the mysql do function) from a broken connection and hangs.

There are no client side query timeout settings for either module.

So, I'm guessing that I need the ability to cause a timeout. In C I would use alarm signals or select. What's the best way to do this in Perl?

Thanks for any help on this.

rotis23
 
any keepalive or heartbeat functions available?
How much control do you have over the client and server, and given the fact the firewall is the problem, can you do anything with that, rather thna having to work around it?

You could write a wrapper function to send/recv dummy data and keep the connection open that way

Just a few thoughts
--Paul


cigless ...
 
I would rather make the client tolerable of this problem that apply fixes to the firewall or server. This way the client can tolerate network outages and other failures that ungracefully terminate the connection.

Apparently I can use SO_KEEPALIVE socket option to maintain a heartbeat within the socket. I know how to get the socket handle from the net::ldap object but I'm not sure if I can do that with the mysql dbi object.

Afetr consulting the Camel on this, it seems that I can use signal alarms and use select with Perl. Stil wondering what the best option is.

Any more suggestions ont hsi out there?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top