Changeset 11415

Show
Ignore:
Timestamp:
05/12/08 01:38:06 (5 years ago)
Author:
topia
Message:

* name resolution error に host をつけるようにした。
* $sock not defined を warn & try next にした。
* unix domain socket で before_connect が呼ばれるようにした。

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/tiarra/trunk/main/Tiarra/Socket/Connect.pm

    r11406 r11415  
    164164 
    165165    if ($entry->answer_status ne $entry->ANSWER_OK) { 
    166         $this->_connect_error("Couldn't resolve hostname"); 
     166        $this->_connect_error("Couldn't resolve hostname: ".$this->host); 
    167167        return undef; # end 
    168168    } 
     
    258258        Proto => 'tcp'); 
    259259    if (!defined $sock) { 
    260         $this->_connect_error( 
    261             $this->sock_errno_to_msg($!, 'Couldn\'t prepare socket'), 
    262             $!); 
     260        $this->_connect_warn("Couldn't prepare socket: $@"); 
     261        $this->_connect_try_next; 
    263262        return; 
    264263    } 
     
    311310    } 
    312311 
     312    eval { 
     313        $this->_call_hooks('before_connect', $this->{connecting}); 
     314    }; if ($@) { 
     315        $this->_call_skip($@); 
     316        $this->_connect_try_next; 
     317        return; 
     318    } 
    313319    require IO::Socket::UNIX; 
    314320    my $sock = IO::Socket::UNIX->new(Peer => $this->{connecting}->{addr});