Show
Ignore:
Timestamp:
04/25/10 03:22:51 (3 years ago)
Author:
topia
Message:

implement resume connecting.

Files:
1 modified

Legend:

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

    r33938 r37269  
    4242#               attach($connector->current_addr, $connector->current_port, 
    4343#                      $msg_or_sock); 
     44#               # その後上手く行かなかったので再開したいとき 
     45#               # まず、いらなくなったソケットをクローズ 
     46#               $msg_or_sock->close; 
     47#               # このサーバは失敗したものとして、次のサーバから再試行 
     48#               $connector->resume; 
    4449#           # timeout を指定したときは実装するようにしてください。 
    4550#           } elsif ($genre eq 'timeout') { 
     
    505510} 
    506511 
     512sub resume { 
     513    my ($this) = @_; 
     514 
     515    if (defined $this->sock) { 
     516        $this->detach; 
     517    } 
     518    $this->_connect_try_next; 
     519} 
     520 
     521sub want_to_read { 
     522    0; 
     523} 
     524 
    507525sub want_to_write { 
    508526    1;