Skip to content

Commit

Permalink
Close handle when closing the stream
Browse files Browse the repository at this point in the history
At the end of the connection, each side sends a close_notify alert to
inform the peer that the connection is closed. IO::Socket::SSL does
that, if its close method is called.
  • Loading branch information
kensanata committed Jun 1, 2023
1 parent 68075c9 commit 08feae9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/Mojo/IOLoop/Stream.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ sub close {
return unless my $handle = delete $self->timeout(0)->{handle};
$reactor->remove($handle);
$self->emit('close');
$handle->close;
}

sub close_gracefully { $_[0]->is_writing ? $_[0]{graceful}++ : $_[0]->close }
Expand Down

0 comments on commit 08feae9

Please sign in to comment.