diff options
| author | fukachan <fukachan> | 2005-05-27 01:22:27 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2005-05-27 01:22:27 +0000 |
| commit | 09aaa34b11e3c5e2555e6da457e880eea4256315 (patch) | |
| tree | 88ffec00e731866056fb4db077d0900f4702075d | |
| parent | bc0ddb3925f5c5bc47db93c5b7d19f5f2739a0d9 (diff) | |
| download | fml8-09aaa34b11e3c5e2555e6da457e880eea4256315.tar.gz fml8-09aaa34b11e3c5e2555e6da457e880eea4256315.tar.bz2 fml8-09aaa34b11e3c5e2555e6da457e880eea4256315.zip | |
set timeout for socket(2).
| -rw-r--r-- | fml/lib/Mail/Delivery/Net/INET4.pm | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fml/lib/Mail/Delivery/Net/INET4.pm b/fml/lib/Mail/Delivery/Net/INET4.pm index 4542f299..fb46b91a 100644 --- a/fml/lib/Mail/Delivery/Net/INET4.pm +++ b/fml/lib/Mail/Delivery/Net/INET4.pm @@ -1,10 +1,10 @@ #-*- perl -*- # -# Copyright (C) 2001,2002,2004 Ken'ichi Fukamachi +# Copyright (C) 2001,2002,2004,2005 Ken'ichi Fukamachi # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: INET4.pm,v 1.9 2004/01/24 09:03:58 fukachan Exp $ +# $FML: INET4.pm,v 1.10 2004/06/29 10:05:29 fukachan Exp $ # package Mail::Delivery::Net::INET4; @@ -28,12 +28,14 @@ sub connect4 my $mta = $args->{ _mta }; my $socket = undef; - # avoid croak() in IO::Socket module; - # XXX-TODO: how long is timeout ??? (where we specified ?) + # XXX we should avoid croak() in IO::Socket module; + # XXX-TODO: timeout must be customizable. eval { local($SIG{ALRM}) = sub { Log("Error: timeout to connect $mta");}; use IO::Socket; - $socket = new IO::Socket::INET($mta); + $socket = new IO::Socket::INET(PeerAddr => $mta, + Timeout => 120, + ); }; if ($@) { Log("Error: cannot create socket for $mta"); @@ -103,7 +105,7 @@ Ken'ichi Fukamachi =head1 COPYRIGHT -Copyright (C) 2001,2002,2004 Ken'ichi Fukamachi +Copyright (C) 2001,2002,2004,2005 Ken'ichi Fukamachi All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
