Skip to content

Commit

Permalink
simplify IO::Socket::IP specific code
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 3, 2014
1 parent 7198e60 commit 273b533
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Mojo/IOLoop/Client.pm
Expand Up @@ -89,9 +89,9 @@ sub _try {
# Retry or handle exceptions
my $handle = $self->{handle};
return $! == EINPROGRESS ? undef : $self->emit(error => $!)
if IPV6 && !$handle->connect;
if $handle->isa('IO::Socket::IP') && !$handle->connect;
return $self->emit(error => $! = $handle->sockopt(SO_ERROR))
if !IPV6 && !$handle->connected;
if !$handle->connected;

# Disable Nagle's algorithm
setsockopt $handle, IPPROTO_TCP, TCP_NODELAY, 1;
Expand Down

0 comments on commit 273b533

Please sign in to comment.