… | |
… | |
404 | |
404 | |
405 | socket my $fh, PF_INET, SOCK_STREAM, 0 |
405 | socket my $fh, PF_INET, SOCK_STREAM, 0 |
406 | or Carp::croak "unable to create new tcp socket: $!"; |
406 | or Carp::croak "unable to create new tcp socket: $!"; |
407 | binmode $fh, ":raw"; |
407 | binmode $fh, ":raw"; |
408 | fcntl $fh, F_SETFL, O_NONBLOCK; |
408 | fcntl $fh, F_SETFL, O_NONBLOCK; |
409 | connect $fh, (sockaddr_in $self->{fcp}{port}, inet_aton $self->{fcp}{host}) |
409 | connect $fh, (sockaddr_in $self->{fcp}{port}, inet_aton $self->{fcp}{host}); |
410 | and !$!{EWOULDBLOCK} |
|
|
411 | and !$!{EINPROGRESS} |
|
|
412 | and Carp::croak "FCP::txn: unable to connect to $self->{fcp}{host}:$self->{fcp}{port}: $!\n"; |
410 | # and Carp::croak "FCP::txn: unable to connect to $self->{fcp}{host}:$self->{fcp}{port}: $!\n"; |
413 | |
411 | |
414 | $self->{sbuf} = |
412 | $self->{sbuf} = |
415 | "\x00\x00\x00\x02" |
413 | "\x00\x00\x00\x02" |
416 | . (Net::FCP::touc $self->{type}) |
414 | . (Net::FCP::touc $self->{type}) |
417 | . "\012$attr$data"; |
415 | . "\012$attr$data"; |